diff options
| author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-09-16 11:55:13 +0200 |
|---|---|---|
| committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-09-16 11:55:13 +0200 |
| commit | a562fea2306c8ba5b47a161568bea5fbe2ffd19f (patch) | |
| tree | fcab88a3a5dd5f05c77934eef0983793f2e2bd6a /tests/wrapper/phpbb_php_ini_test.php | |
| parent | d4a47409f7da09790f38d3418401cbe34f8c3703 (diff) | |
| parent | 6651c1d8f4aead15f4750989670f75721390ee21 (diff) | |
| download | forums-a562fea2306c8ba5b47a161568bea5fbe2ffd19f.tar forums-a562fea2306c8ba5b47a161568bea5fbe2ffd19f.tar.gz forums-a562fea2306c8ba5b47a161568bea5fbe2ffd19f.tar.bz2 forums-a562fea2306c8ba5b47a161568bea5fbe2ffd19f.tar.xz forums-a562fea2306c8ba5b47a161568bea5fbe2ffd19f.zip | |
Merge pull request #3727 from marc1706/ticket/13904
[ticket/13904] Refactor attachments functions into service
* marc1706/ticket/13904: (66 commits)
[ticket/13904] Use filespec's get_filesize instead of calling filesize()
[ticket/13904] Set properties to protected where possible in filespec
[ticket/13904] Fix tests after changes to factory
[ticket/13904] Minor coding style fixes
[ticket/13904] Add language entries for error messages in upload class
[ticket/13904] Modify files for updated fast-image-size library
[ticket/13904] Update composer.lock
[ticket/13904] Improve code coverage
[ticket/13904] Add unit tests for local upload type
[ticket/13904] Minor coding style fixes
[ticket/13904] Improve test coverage of base upload type class
[ticket/13904] Improve test coverage of remote upload type
[ticket/13904] Improve test coverage of form upload type
[ticket/13904] Improve test coverage of filespec class
[ticket/13904] Add back tests for retrieving floats
[ticket/13904] Use ini_get() wrapper in file upload types
[ticket/13904] Modify files for changes in ini wrapper
[ticket/13904] Add bantu/ini-get-wrapper to composer.json
[ticket/13904] Switch around constructor arguments
[ticket/13904] Use \phpbb\php\ini class for ini_get()
...
Diffstat (limited to 'tests/wrapper/phpbb_php_ini_test.php')
| -rw-r--r-- | tests/wrapper/phpbb_php_ini_test.php | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/tests/wrapper/phpbb_php_ini_test.php b/tests/wrapper/phpbb_php_ini_test.php index 27c2487f0a..9f46a78d5b 100644 --- a/tests/wrapper/phpbb_php_ini_test.php +++ b/tests/wrapper/phpbb_php_ini_test.php @@ -16,6 +16,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; class phpbb_wrapper_phpbb_php_ini_test extends phpbb_test_case { + /** @var \phpbb_php_ini_fake php_ini */ protected $php_ini; public function setUp() @@ -25,44 +26,44 @@ class phpbb_wrapper_phpbb_php_ini_test extends phpbb_test_case public function test_get_string() { - $this->assertSame(false, $this->php_ini->get_string(false)); - $this->assertSame('phpbb', $this->php_ini->get_string(' phpbb ')); + $this->assertSame('', $this->php_ini->getString(false)); + $this->assertSame('phpbb', $this->php_ini->getString(' phpbb ')); } public function test_get_bool() { - $this->assertSame(true, $this->php_ini->get_bool('ON')); - $this->assertSame(true, $this->php_ini->get_bool('on')); - $this->assertSame(true, $this->php_ini->get_bool('1')); + $this->assertSame(true, $this->php_ini->getBool('ON')); + $this->assertSame(true, $this->php_ini->getBool('on')); + $this->assertSame(true, $this->php_ini->getBool('1')); - $this->assertSame(false, $this->php_ini->get_bool('OFF')); - $this->assertSame(false, $this->php_ini->get_bool('off')); - $this->assertSame(false, $this->php_ini->get_bool('0')); - $this->assertSame(false, $this->php_ini->get_bool('')); + $this->assertSame(false, $this->php_ini->getBool('OFF')); + $this->assertSame(false, $this->php_ini->getBool('off')); + $this->assertSame(false, $this->php_ini->getBool('0')); + $this->assertSame(false, $this->php_ini->getBool('')); } public function test_get_int() { - $this->assertSame(1234, $this->php_ini->get_int('1234')); - $this->assertSame(-12345, $this->php_ini->get_int('-12345')); - $this->assertSame(false, $this->php_ini->get_int('phpBB')); + $this->assertSame(1234, $this->php_ini->getNumeric('1234')); + $this->assertSame(-12345, $this->php_ini->getNumeric('-12345')); + $this->assertSame(null, $this->php_ini->getNumeric('phpBB')); } public function test_get_float() { - $this->assertSame(1234.0, $this->php_ini->get_float('1234')); - $this->assertSame(-12345.0, $this->php_ini->get_float('-12345')); - $this->assertSame(false, $this->php_ini->get_float('phpBB')); + $this->assertSame(1234.0, $this->php_ini->getNumeric('1234.0')); + $this->assertSame(-12345.0, $this->php_ini->getNumeric('-12345.0')); + $this->assertSame(null, $this->php_ini->getNumeric('phpBB')); } public function test_get_bytes_invalid() { - $this->assertSame(false, $this->php_ini->get_bytes(false)); - $this->assertSame(false, $this->php_ini->get_bytes('phpBB')); - $this->assertSame(false, $this->php_ini->get_bytes('k')); - $this->assertSame(false, $this->php_ini->get_bytes('-k')); - $this->assertSame(false, $this->php_ini->get_bytes('M')); - $this->assertSame(false, $this->php_ini->get_bytes('-M')); + $this->assertSame(null, $this->php_ini->getBytes(false)); + $this->assertSame(null, $this->php_ini->getBytes('phpBB')); + $this->assertSame(null, $this->php_ini->getBytes('k')); + $this->assertSame(null, $this->php_ini->getBytes('-k')); + $this->assertSame(null, $this->php_ini->getBytes('M')); + $this->assertSame(null, $this->php_ini->getBytes('-M')); } /** @@ -70,7 +71,7 @@ class phpbb_wrapper_phpbb_php_ini_test extends phpbb_test_case */ public function test_get_bytes($expected, $value) { - $actual = $this->php_ini->get_bytes($value); + $actual = $this->php_ini->getBytes($value); $this->assertTrue(is_float($actual) || is_int($actual)); $this->assertEquals($expected, $actual); |
