Replacement of assertEquals() to assertSame()
This commit is contained in:
@ -43,8 +43,8 @@ class SessionTest extends PHPUnit_Framework_TestCase
|
||||
Session::set('one', 1);
|
||||
Session::set('two', 'three');
|
||||
Session::set(array('first' => '1st', 'second' => '2nd'));
|
||||
$this->assertEquals('1st', Session::get('first'));
|
||||
$this->assertEquals('three', Session::get('two'));
|
||||
$this->assertSame('1st', Session::get('first'));
|
||||
$this->assertSame('three', Session::get('two'));
|
||||
$this->assertNotEquals('three', Session::get('thr'));
|
||||
}
|
||||
|
||||
@ -58,21 +58,21 @@ class SessionTest extends PHPUnit_Framework_TestCase
|
||||
public function testReturnDefaultValue()
|
||||
{
|
||||
Session::start();
|
||||
$this->assertEquals(1, Session::get('key', 1));
|
||||
$this->assertSame(1, Session::get('key', 1));
|
||||
}
|
||||
|
||||
public function testDestroyedGet()
|
||||
{
|
||||
$this->assertFalse($this->started->getValue());
|
||||
$_COOKIE[session_name()] = session_name();
|
||||
$this->assertEquals(1, Session::get('key', 1));
|
||||
$this->assertSame(1, Session::get('key', 1));
|
||||
}
|
||||
|
||||
public function testDel()
|
||||
{
|
||||
Session::set('one', 1);
|
||||
Session::set('two', 'three');
|
||||
$this->assertEquals('three', Session::get('two'));
|
||||
$this->assertSame('three', Session::get('two'));
|
||||
Session::del('two');
|
||||
$this->assertNull(Session::get('two'));
|
||||
}
|
||||
@ -109,10 +109,10 @@ class SessionTest extends PHPUnit_Framework_TestCase
|
||||
$new_params = session_get_cookie_params();
|
||||
$this->assertNotEquals($ssid, $new_ssid);
|
||||
$this->assertNotEquals($params, $new_params);
|
||||
$this->assertEquals(400, $new_params['lifetime']);
|
||||
$this->assertSame(400, $new_params['lifetime']);
|
||||
Session::rememberUntil();
|
||||
$new_params = session_get_cookie_params();
|
||||
$this->assertEquals(0, $new_params['lifetime']);
|
||||
$this->assertSame(0, $new_params['lifetime']);
|
||||
}
|
||||
|
||||
public function testForget()
|
||||
@ -123,7 +123,7 @@ class SessionTest extends PHPUnit_Framework_TestCase
|
||||
$new_ssid = Session::getId();
|
||||
$new_params = session_get_cookie_params();
|
||||
$this->assertNotEquals($ssid, $new_ssid);
|
||||
$this->assertEquals(0, $new_params['lifetime']);
|
||||
$this->assertSame(0, $new_params['lifetime']);
|
||||
}
|
||||
|
||||
public function testRemember()
|
||||
@ -132,15 +132,15 @@ class SessionTest extends PHPUnit_Framework_TestCase
|
||||
$ssid = Session::getId();
|
||||
Session::remember();
|
||||
$new_params = session_get_cookie_params();
|
||||
$this->assertEquals(1209600, $new_params['lifetime']);
|
||||
$this->assertSame(1209600, $new_params['lifetime']);
|
||||
|
||||
Session::remember(-30);
|
||||
$new_params = session_get_cookie_params();
|
||||
$this->assertEquals(1209600, $new_params['lifetime']);
|
||||
$this->assertSame(1209600, $new_params['lifetime']);
|
||||
|
||||
Session::remember(530);
|
||||
$new_params = session_get_cookie_params();
|
||||
$this->assertEquals(530, $new_params['lifetime']);
|
||||
$this->assertSame(530, $new_params['lifetime']);
|
||||
}
|
||||
|
||||
public function testExpireSessionCookie()
|
||||
|
Reference in New Issue
Block a user