Skip to content

Commit

Permalink
Merge pull request #373 from shama/patch-test-case-order
Browse files Browse the repository at this point in the history
Correcting assertEquals parameter order
  • Loading branch information
ceeram committed Dec 13, 2011
2 parents 645ef47 + b46c4b3 commit 276ae15
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
Expand Up @@ -361,31 +361,31 @@ public function testMaskSetting() {
$write = Cache::write('masking_test', $data, 'mask_test');
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
$expected = '0664';
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
Cache::delete('masking_test', 'mask_test');
Cache::drop('mask_test');

Cache::config('mask_test', array('engine' => 'File', 'mask' => 0666, 'path' => TMP . 'tests'));
$write = Cache::write('masking_test', $data, 'mask_test');
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
$expected = '0666';
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
Cache::delete('masking_test', 'mask_test');
Cache::drop('mask_test');

Cache::config('mask_test', array('engine' => 'File', 'mask' => 0644, 'path' => TMP . 'tests'));
$write = Cache::write('masking_test', $data, 'mask_test');
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
$expected = '0644';
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
Cache::delete('masking_test', 'mask_test');
Cache::drop('mask_test');

Cache::config('mask_test', array('engine' => 'File', 'mask' => 0640, 'path' => TMP . 'tests'));
$write = Cache::write('masking_test', $data, 'mask_test');
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
$expected = '0640';
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
Cache::delete('masking_test', 'mask_test');
Cache::drop('mask_test');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
Expand Up @@ -890,7 +890,7 @@ public function testBehaviorSaveCallbacks() {
$Sample->create();
$result = $Sample->save($record);
$expected['Sample']['id'] = $Sample->id;
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);

$Sample->Behaviors->attach('Test', array('beforeSave' => 'modify', 'afterSave' => 'modify'));
$expected = Set::merge($record, array('Sample' => array('name' => 'sample99 modified before modified after on create')));
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
Expand Up @@ -1932,7 +1932,7 @@ public function testStringConditionsParsing() {
$conditions = array('Company.name similar to ' => 'a word');
$result = $this->Dbo->conditions($conditions);
$expected = " WHERE `Company`.`name` similar to 'a word'";
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
}

/**
Expand Down Expand Up @@ -2104,7 +2104,7 @@ public function testArrayConditionsParsing() {

$result = $this->Dbo->conditions(array('lower(Article.title)' => 'secrets'));
$expected = " WHERE lower(`Article`.`title`) = 'secrets'";
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);

$result = $this->Dbo->conditions(array('title LIKE' => '%hello'));
$expected = " WHERE `title` LIKE '%hello'";
Expand Down Expand Up @@ -2279,7 +2279,7 @@ public function testArrayConditionsParsing() {
$conditions = array('MysqlModel.id' => '');
$result = $this->Dbo->conditions($conditions, true, true, $this->model);
$expected = " WHERE `MysqlModel`.`id` IS NULL";
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);

$result = $this->Dbo->conditions(array('Listing.beds >=' => 0));
$expected = " WHERE `Listing`.`beds` >= 0";
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Model/ModelIntegrationTest.php
Expand Up @@ -272,7 +272,7 @@ function testFindWithJoinsOption() {
array('User' => array('user' => 'mariano'), 'Article' => array('published' => 'Y')),
array('User' => array('user' => 'nate'), 'Article' => array('published' => ''))
);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions lib/Cake/Test/Case/Model/ModelReadTest.php
Expand Up @@ -7561,31 +7561,31 @@ public function testVirtualFieldsOrder() {
'2' => 'Second Post',
'1' => 'First Post'
);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);

$result = $Post->find('list', array('order' => array('Post.other_field' => 'DESC')));
$expected = array(
'1' => 'First Post',
'2' => 'Second Post',
'3' => 'Third Post'
);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);

$Post->Author->virtualFields = array('joined' => 'Post.id * Author.id');
$result = $Post->find('all');
$result = Set::extract('{n}.Author.joined', $result);
$expected = array(1, 6, 3);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);

$result = $Post->find('all', array('order' => array('Author.joined' => 'ASC')));
$result = Set::extract('{n}.Author.joined', $result);
$expected = array(1, 3, 6);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);

$result = $Post->find('all', array('order' => array('Author.joined' => 'DESC')));
$result = Set::extract('{n}.Author.joined', $result);
$expected = array(6, 3, 1);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Test/Case/Routing/RouterTest.php
Expand Up @@ -149,7 +149,7 @@ public function testPluginMapResources() {
'action' => 'index',
'[method]' => 'GET'
);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
$this->assertEquals($resources, array('test_plugin'));

$_SERVER['REQUEST_METHOD'] = 'GET';
Expand All @@ -163,7 +163,7 @@ public function testPluginMapResources() {
'id' => '13',
'[method]' => 'GET'
);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
}

/**
Expand All @@ -189,7 +189,7 @@ public function testPluginMapResourcesWithPrefix() {
'action' => 'index',
'[method]' => 'GET'
);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
$this->assertEquals($resources, array('test_plugin'));
}

Expand Down

0 comments on commit 276ae15

Please sign in to comment.