[ticket/10931] Use strict assertSame() instead of assertEquals().

PHPBB3-10931
This commit is contained in:
Andreas Fischer 2012-06-11 14:43:50 +02:00
parent 3872abd824
commit 44287e57bf

View file

@ -20,42 +20,42 @@ class phpbb_wrapper_phpbb_php_ini_test extends phpbb_test_case
public function test_get_string()
{
$this->assertEquals('phpbb', $this->php_ini->get_string(' phpbb '));
$this->assertSame('phpbb', $this->php_ini->get_string(' phpbb '));
}
public function test_get_bool()
{
$this->assertEquals(true, $this->php_ini->get_bool('ON'));
$this->assertEquals(true, $this->php_ini->get_bool('on'));
$this->assertEquals(true, $this->php_ini->get_bool('1'));
$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->assertEquals(false, $this->php_ini->get_bool('OFF'));
$this->assertEquals(false, $this->php_ini->get_bool('off'));
$this->assertEquals(false, $this->php_ini->get_bool('0'));
$this->assertEquals(false, $this->php_ini->get_bool(''));
$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(''));
}
public function test_get_int()
{
$this->assertEquals(1234, $this->php_ini->get_int('1234'));
$this->assertEquals(-12345, $this->php_ini->get_int('-12345'));
$this->assertEquals(false, $this->php_ini->get_int('phpBB'));
$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'));
}
public function test_get_float()
{
$this->assertEquals(1234.0, $this->php_ini->get_float('1234'));
$this->assertEquals(-12345.0, $this->php_ini->get_float('-12345'));
$this->assertEquals(false, $this->php_ini->get_float('phpBB'));
$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'));
}
public function test_get_bytes()
{
$this->assertEquals(false, $this->php_ini->get_bytes('phpBB'));
$this->assertEquals(false, $this->php_ini->get_bytes('k'));
$this->assertEquals(false, $this->php_ini->get_bytes('-k'));
$this->assertEquals(false, $this->php_ini->get_bytes('M'));
$this->assertEquals(false, $this->php_ini->get_bytes('-M'));
$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->assertEquals(32 * pow(2, 20), $this->php_ini->get_bytes('32m'));
$this->assertEquals(- 32 * pow(2, 20), $this->php_ini->get_bytes('-32m'));
$this->assertEquals(8 * pow(2, 30), $this->php_ini->get_bytes('8G'));