Skip to content

Commit

Permalink
updating usage of assertEqual -> assertEquals
Browse files Browse the repository at this point in the history
  • Loading branch information
rchavik committed Dec 13, 2011
1 parent 8444911 commit a88ca54
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Core/AppTest.php
Expand Up @@ -207,7 +207,7 @@ public function testCompatibleBuild() {
*/
public function testBuildPackage() {
$paths = App::path('Service');
$this->assertEqual(array(), $paths);
$this->assertEquals(array(), $paths);

App::build(array(
'Service' => array(
Expand Down
42 changes: 21 additions & 21 deletions lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php
Expand Up @@ -43,13 +43,13 @@ function testModelDatasources() {
$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() {
Expand All @@ -67,19 +67,19 @@ function testHabtmFind() {
),
),
));
$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'),
'conditions' => array(
'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));
}


Expand All @@ -88,7 +88,7 @@ function testHabtmSave() {

$Player =& ClassRegistry::init('Player');
$players = $Player->find('count');
$this->assertEqual(4, $players);
$this->assertEquals(4, $players);

$player = $Player->create(array(
'name' => 'rchavik',
Expand All @@ -97,10 +97,10 @@ function testHabtmSave() {
$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']);
Expand All @@ -109,7 +109,7 @@ function testHabtmSave() {
$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(
Expand All @@ -120,7 +120,7 @@ function testHabtmSave() {
));

$rangers = Set::extract('/Guild[name=Rangers]', $players);
$this->assertEqual(2, count($rangers));
$this->assertEquals(2, count($rangers));
}

function testHabtmWithThreeDatabases() {
Expand All @@ -142,11 +142,11 @@ function testHabtmWithThreeDatabases() {
),
),
), 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,
Expand All @@ -169,15 +169,15 @@ function testHabtmWithThreeDatabases() {
);
unset($result['Player']['created']);
unset($result['Player']['updated']);
$this->assertEqual($expected, $result);
$this->assertEquals($expected, $result);

$spongebob = $Player->find('all', array(
'conditions' => array(
'Player.id' => 10,
)
));
$spongeBobsArmors = Set::extract('/Armor', $spongebob);
$this->assertEqual(4, count($spongeBobsArmors));
$this->assertEquals(4, count($spongeBobsArmors));
}

}
44 changes: 22 additions & 22 deletions lib/Cake/Test/Case/Model/ModelIntegrationTest.php
Expand Up @@ -2243,18 +2243,18 @@ public function testMultischemaFixture() {
$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);
}

/**
Expand All @@ -2281,27 +2281,27 @@ public function testMultischemaFixtureWithThreeDatabases() {
),
),
), 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);
}

}
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/View/Helper/TextHelperTest.php
Expand Up @@ -240,12 +240,12 @@ public function testAutoLinkEscape() {
$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);
}

/**
Expand Down

0 comments on commit a88ca54

Please sign in to comment.