updating usage of assertEqual -> assertEquals

This commit is contained in:
Rachman Chavik 2011-12-13 20:54:05 +07:00
parent 8444911761
commit a88ca54a8d
4 changed files with 46 additions and 46 deletions

View file

@ -207,7 +207,7 @@ class AppTest extends CakeTestCase {
*/
public function testBuildPackage() {
$paths = App::path('Service');
$this->assertEqual(array(), $paths);
$this->assertEquals(array(), $paths);
App::build(array(
'Service' => array(

View file

@ -43,13 +43,13 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
$this->loadFixtures('Player', 'Guild', 'GuildsPlayer');
$Player = ClassRegistry::init('Player');
$this->assertEqual('test', $Player->useDbConfig);
$this->assertEqual('test', $Player->Guild->useDbConfig);
$this->assertEqual('test2', $Player->GuildsPlayer->useDbConfig);
$this->assertEquals('test', $Player->useDbConfig);
$this->assertEquals('test', $Player->Guild->useDbConfig);
$this->assertEquals('test2', $Player->GuildsPlayer->useDbConfig);
$this->assertEqual('test', $Player->getDataSource()->configKeyName);
$this->assertEqual('test', $Player->Guild->getDataSource()->configKeyName);
$this->assertEqual('test2', $Player->GuildsPlayer->getDataSource()->configKeyName);
$this->assertEquals('test', $Player->getDataSource()->configKeyName);
$this->assertEquals('test', $Player->Guild->getDataSource()->configKeyName);
$this->assertEquals('test2', $Player->GuildsPlayer->getDataSource()->configKeyName);
}
function testHabtmFind() {
@ -67,9 +67,9 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
),
),
));
$this->assertEqual(4, count($players));
$this->assertEquals(4, count($players));
$wizards = Set::extract('/Guild[name=Wizards]', $players);
$this->assertEqual(1, count($wizards));
$this->assertEquals(1, count($wizards));
$players = $Player->find('all', array(
'fields' => array('id', 'name'),
@ -77,9 +77,9 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
'Player.id' => 1,
),
));
$this->assertEqual(1, count($players));
$this->assertEquals(1, count($players));
$wizards = Set::extract('/Guild', $players);
$this->assertEqual(2, count($wizards));
$this->assertEquals(2, count($wizards));
}
@ -88,7 +88,7 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
$Player =& ClassRegistry::init('Player');
$players = $Player->find('count');
$this->assertEqual(4, $players);
$this->assertEquals(4, $players);
$player = $Player->create(array(
'name' => 'rchavik',
@ -97,10 +97,10 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
$results = $Player->saveAll($player, array('validate' => 'first'));
$this->assertNotEqual(false, $results);
$count = $Player->find('count');
$this->assertEqual(5, $count);
$this->assertEquals(5, $count);
$count = $Player->GuildsPlayer->find('count');
$this->assertEqual(3, $count);
$this->assertEquals(3, $count);
$player = $Player->findByName('rchavik');
$this->assertEmpty($player['Guild']);
@ -109,7 +109,7 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
$Player->save($player);
$player = $Player->findByName('rchavik');
$this->assertEqual(3, count($player['Guild']));
$this->assertEquals(3, count($player['Guild']));
$players = $Player->find('all', array(
'contain' => array(
@ -120,7 +120,7 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
));
$rangers = Set::extract('/Guild[name=Rangers]', $players);
$this->assertEqual(2, count($rangers));
$this->assertEquals(2, count($rangers));
}
function testHabtmWithThreeDatabases() {
@ -142,11 +142,11 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
),
),
), false);
$this->assertEqual('test', $Player->useDbConfig);
$this->assertEqual('test2', $Player->Armor->useDbConfig);
$this->assertEqual('test_database_three', $Player->ArmorsPlayer->useDbConfig);
$this->assertEquals('test', $Player->useDbConfig);
$this->assertEquals('test2', $Player->Armor->useDbConfig);
$this->assertEquals('test_database_three', $Player->ArmorsPlayer->useDbConfig);
$players = $Player->find('count');
$this->assertEqual(4, $players);
$this->assertEquals(4, $players);
$spongebob = $Player->create(array(
'id' => 10,
@ -169,7 +169,7 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
);
unset($result['Player']['created']);
unset($result['Player']['updated']);
$this->assertEqual($expected, $result);
$this->assertEquals($expected, $result);
$spongebob = $Player->find('all', array(
'conditions' => array(
@ -177,7 +177,7 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
)
));
$spongeBobsArmors = Set::extract('/Armor', $spongebob);
$this->assertEqual(4, count($spongeBobsArmors));
$this->assertEquals(4, count($spongeBobsArmors));
}
}

View file

@ -2243,18 +2243,18 @@ class ModelIntegrationTest extends BaseModelTest {
$this->loadFixtures('Player', 'Guild', 'GuildsPlayer');
$Player = ClassRegistry::init('Player');
$this->assertEqual($Player->useDbConfig, 'test');
$this->assertEqual($Player->Guild->useDbConfig, 'test');
$this->assertEqual($Player->Guild->GuildsPlayer->useDbConfig, 'test2');
$this->assertEqual($Player->GuildsPlayer->useDbConfig, 'test2');
$this->assertEquals($Player->useDbConfig, 'test');
$this->assertEquals($Player->Guild->useDbConfig, 'test');
$this->assertEquals($Player->Guild->GuildsPlayer->useDbConfig, 'test2');
$this->assertEquals($Player->GuildsPlayer->useDbConfig, 'test2');
$players = $Player->find('all', array('recursive' => -1));
$guilds = $Player->Guild->find('all', array('recursive' => -1));
$guildsPlayers = $Player->GuildsPlayer->find('all', array('recursive' => -1));
$this->assertEqual(true, count($players) > 1);
$this->assertEqual(true, count($guilds) > 1);
$this->assertEqual(true, count($guildsPlayers) > 1);
$this->assertEquals(true, count($players) > 1);
$this->assertEquals(true, count($guilds) > 1);
$this->assertEquals(true, count($guildsPlayers) > 1);
}
/**
@ -2281,27 +2281,27 @@ class ModelIntegrationTest extends BaseModelTest {
),
),
), false);
$this->assertEqual('test', $Player->useDbConfig);
$this->assertEqual('test', $Player->Guild->useDbConfig);
$this->assertEqual('test2', $Player->Guild->GuildsPlayer->useDbConfig);
$this->assertEqual('test2', $Player->GuildsPlayer->useDbConfig);
$this->assertEqual('test2', $Player->Armor->useDbConfig);
$this->assertEqual('test_database_three', $Player->Armor->ArmorsPlayer->useDbConfig);
$this->assertEqual('test', $Player->getDataSource()->configKeyName);
$this->assertEqual('test', $Player->Guild->getDataSource()->configKeyName);
$this->assertEqual('test2', $Player->GuildsPlayer->getDataSource()->configKeyName);
$this->assertEqual('test2', $Player->Armor->getDataSource()->configKeyName);
$this->assertEqual('test_database_three', $Player->Armor->ArmorsPlayer->getDataSource()->configKeyName);
$this->assertEquals('test', $Player->useDbConfig);
$this->assertEquals('test', $Player->Guild->useDbConfig);
$this->assertEquals('test2', $Player->Guild->GuildsPlayer->useDbConfig);
$this->assertEquals('test2', $Player->GuildsPlayer->useDbConfig);
$this->assertEquals('test2', $Player->Armor->useDbConfig);
$this->assertEquals('test_database_three', $Player->Armor->ArmorsPlayer->useDbConfig);
$this->assertEquals('test', $Player->getDataSource()->configKeyName);
$this->assertEquals('test', $Player->Guild->getDataSource()->configKeyName);
$this->assertEquals('test2', $Player->GuildsPlayer->getDataSource()->configKeyName);
$this->assertEquals('test2', $Player->Armor->getDataSource()->configKeyName);
$this->assertEquals('test_database_three', $Player->Armor->ArmorsPlayer->getDataSource()->configKeyName);
$players = $Player->find('all', array('recursive' => -1));
$guilds = $Player->Guild->find('all', array('recursive' => -1));
$guildsPlayers = $Player->GuildsPlayer->find('all', array('recursive' => -1));
$armorsPlayers = $Player->ArmorsPlayer->find('all', array('recursive' => -1));
$this->assertEqual(true, count($players) > 1);
$this->assertEqual(true, count($guilds) > 1);
$this->assertEqual(true, count($guildsPlayers) > 1);
$this->assertEqual(true, count($armorsPlayers) > 1);
$this->assertEquals(true, count($players) > 1);
$this->assertEquals(true, count($guilds) > 1);
$this->assertEquals(true, count($guildsPlayers) > 1);
$this->assertEquals(true, count($armorsPlayers) > 1);
}
}

View file

@ -240,12 +240,12 @@ class TextHelperTest extends CakeTestCase {
$text = 'This is a <b>test</b> text with URL http://www.cakephp.org';
$expected = 'This is a &lt;b&gt;test&lt;/b&gt; text with URL <a href="http://www.cakephp.org">http://www.cakephp.org</a>';
$result = $this->Text->autoLink($text);
$this->assertEqual($expected, $result);
$this->assertEquals($expected, $result);
$text = 'This is a <b>test</b> text with URL http://www.cakephp.org';
$expected = 'This is a <b>test</b> text with URL <a href="http://www.cakephp.org">http://www.cakephp.org</a>';
$result = $this->Text->autoLink($text, array('escape' => false));
$this->assertEqual($expected, $result);
$this->assertEquals($expected, $result);
}
/**