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

@ -52,13 +52,13 @@ class ModelTest extends PHPUnit_Framework_TestCase
public function testIdentify()
{
$param = 'param';
$this->assertEquals($param, $this->model->identify($param));
$this->assertSame($param, $this->model->identify($param));
}
public function testQuote()
{
$param = 'param';
$this->assertEquals($param, $this->model->quote($param));
$this->assertSame($param, $this->model->quote($param));
}
public function testGet()
@ -73,12 +73,12 @@ class ModelTest extends PHPUnit_Framework_TestCase
public function testUpdate()
{
$this->assertEquals('mock', $this->model->update(array('var' => 'val'), 1));
$this->assertSame('mock', $this->model->update(array('var' => 'val'), 1));
}
public function testDelete()
{
$this->assertEquals('mock', $this->model->delete(1));
$this->assertSame('mock', $this->model->delete(1));
}
public function testOrder()
@ -86,14 +86,14 @@ class ModelTest extends PHPUnit_Framework_TestCase
$model = new ReflectionClass('Model');
$method = $model->getMethod('order');
$method->setAccessible(true);
$this->assertEquals(' ORDER BY id DESC', $method->invoke($this->model, array('sort' => 'id', 'order' => 'desc')));
$this->assertEquals(' ORDER BY name ASC', $method->invoke($this->model, array('sort' => 'name'), array('id', 'name')));
$this->assertSame(' ORDER BY id DESC', $method->invoke($this->model, array('sort' => 'id', 'order' => 'desc')));
$this->assertSame(' ORDER BY name ASC', $method->invoke($this->model, array('sort' => 'name'), array('id', 'name')));
$this->assertEmpty($method->invoke($this->model, array()));
/**
* @TODO: Model::order - check DESC condition - make case insensitive
*/
$this->assertEquals(' ORDER BY name ASC', $method->invoke($this->model, array('sort' => 'name', 'order' => 'DESC'), array('id', 'name')));
$this->assertSame(' ORDER BY name ASC', $method->invoke($this->model, array('sort' => 'name', 'order' => 'DESC'), array('id', 'name')));
}
public function testSearch()
@ -103,7 +103,7 @@ class ModelTest extends PHPUnit_Framework_TestCase
$method->setAccessible(true);
$this->assertEmpty($method->invoke($this->model, array()));
$this->assertEmpty($method->invoke($this->model, array('q' => 'in', 'qt' => 'name')));
$this->assertEquals('test.name LIKE %on%', $method->invoke($this->model, array('qt' => 'name', 'q' => 'on'), array('name'), 'test'));
$this->assertSame('test.name LIKE %on%', $method->invoke($this->model, array('qt' => 'name', 'q' => 'on'), array('name'), 'test'));
}
public function testFetch()
@ -122,7 +122,7 @@ class ModelTest extends PHPUnit_Framework_TestCase
$method->setAccessible(true);
$key = $this->getCacheKeyMockGetSet();
$this->assertEquals('field', $method->invoke($this->model, 'SELECT', array(), 'field', $key));
$this->assertSame('field', $method->invoke($this->model, 'SELECT', array(), 'field', $key));
}
public function testFetchAll()