Replacement of assertEquals() to assertSame()

This commit is contained in:
Vyacheslav Agafonov
2011-12-02 17:22:31 +04:00
parent 3a79d203c7
commit 0fdcb87653
35 changed files with 214 additions and 214 deletions

View File

@ -18,8 +18,8 @@ class RouteTest extends PHPUnit_Framework_TestCase
public function testConstructNoParams()
{
$route = new Route('index', 'user');
$this->assertEquals('userAction', $route->getAction());
$this->assertEquals('Layout', $route->getLayout());
$this->assertSame('userAction', $route->getAction());
$this->assertSame('Layout', $route->getLayout());
$this->assertEmpty($route->getParams());
$this->assertAttributeEquals('index', 'route', $route);
}
@ -28,7 +28,7 @@ class RouteTest extends PHPUnit_Framework_TestCase
{
$route = new Route('index', 'user', array('name' => 'tony', 'role' => 'user'));
$this->assertArrayHasKey('role', $route->getParams());
$this->assertEquals(array('name' => 'tony', 'role' => 'user'), $route->getParams());
$this->assertSame(array('name' => 'tony', 'role' => 'user'), $route->getParams());
}
public function testMatchDiffCount()
@ -50,22 +50,22 @@ class RouteTest extends PHPUnit_Framework_TestCase
{
$route = new Route('user/account/:id', 'user');
$this->assertTrue($route->match(array('user', 'account', '142')));
$this->assertEquals(array('id' => '142'), $route->getParams());
$this->assertSame(array('id' => '142'), $route->getParams());
}
public function testMatchDiffPregParts()
{
$route = new Route('user/account/(?<key>value)', 'user');
$this->assertFalse($route->match(array('user', 'account', 'wrong')));
$this->assertEquals(0, count($route->getParams()));
$this->assertSame(0, count($route->getParams()));
}
public function testMatchPregPasses()
{
$route = new Route('user/account/(?<key>[a-z]+)', 'user');
$this->assertTrue($route->match(array('user', 'account', 'value')));
$this->assertEquals(array('key' => 'value'), $route->getParams());
$this->assertEquals(1, count($route->getParams()));
$this->assertSame(array('key' => 'value'), $route->getParams());
$this->assertSame(1, count($route->getParams()));
}
/**