mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Correcting assertEquals parameter order
This commit is contained in:
parent
645ef47878
commit
b46c4b3e3f
6 changed files with 17 additions and 17 deletions
|
@ -361,7 +361,7 @@ class FileEngineTest extends CakeTestCase {
|
||||||
$write = Cache::write('masking_test', $data, 'mask_test');
|
$write = Cache::write('masking_test', $data, 'mask_test');
|
||||||
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
|
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
|
||||||
$expected = '0664';
|
$expected = '0664';
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
Cache::delete('masking_test', 'mask_test');
|
Cache::delete('masking_test', 'mask_test');
|
||||||
Cache::drop('mask_test');
|
Cache::drop('mask_test');
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ class FileEngineTest extends CakeTestCase {
|
||||||
$write = Cache::write('masking_test', $data, 'mask_test');
|
$write = Cache::write('masking_test', $data, 'mask_test');
|
||||||
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
|
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
|
||||||
$expected = '0666';
|
$expected = '0666';
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
Cache::delete('masking_test', 'mask_test');
|
Cache::delete('masking_test', 'mask_test');
|
||||||
Cache::drop('mask_test');
|
Cache::drop('mask_test');
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ class FileEngineTest extends CakeTestCase {
|
||||||
$write = Cache::write('masking_test', $data, 'mask_test');
|
$write = Cache::write('masking_test', $data, 'mask_test');
|
||||||
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
|
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
|
||||||
$expected = '0644';
|
$expected = '0644';
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
Cache::delete('masking_test', 'mask_test');
|
Cache::delete('masking_test', 'mask_test');
|
||||||
Cache::drop('mask_test');
|
Cache::drop('mask_test');
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ class FileEngineTest extends CakeTestCase {
|
||||||
$write = Cache::write('masking_test', $data, 'mask_test');
|
$write = Cache::write('masking_test', $data, 'mask_test');
|
||||||
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
|
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
|
||||||
$expected = '0640';
|
$expected = '0640';
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
Cache::delete('masking_test', 'mask_test');
|
Cache::delete('masking_test', 'mask_test');
|
||||||
Cache::drop('mask_test');
|
Cache::drop('mask_test');
|
||||||
}
|
}
|
||||||
|
|
|
@ -890,7 +890,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
||||||
$Sample->create();
|
$Sample->create();
|
||||||
$result = $Sample->save($record);
|
$result = $Sample->save($record);
|
||||||
$expected['Sample']['id'] = $Sample->id;
|
$expected['Sample']['id'] = $Sample->id;
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$Sample->Behaviors->attach('Test', array('beforeSave' => 'modify', 'afterSave' => 'modify'));
|
$Sample->Behaviors->attach('Test', array('beforeSave' => 'modify', 'afterSave' => 'modify'));
|
||||||
$expected = Set::merge($record, array('Sample' => array('name' => 'sample99 modified before modified after on create')));
|
$expected = Set::merge($record, array('Sample' => array('name' => 'sample99 modified before modified after on create')));
|
||||||
|
|
|
@ -1932,7 +1932,7 @@ class MysqlTest extends CakeTestCase {
|
||||||
$conditions = array('Company.name similar to ' => 'a word');
|
$conditions = array('Company.name similar to ' => 'a word');
|
||||||
$result = $this->Dbo->conditions($conditions);
|
$result = $this->Dbo->conditions($conditions);
|
||||||
$expected = " WHERE `Company`.`name` similar to 'a word'";
|
$expected = " WHERE `Company`.`name` similar to 'a word'";
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2104,7 +2104,7 @@ class MysqlTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = $this->Dbo->conditions(array('lower(Article.title)' => 'secrets'));
|
$result = $this->Dbo->conditions(array('lower(Article.title)' => 'secrets'));
|
||||||
$expected = " WHERE 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'));
|
$result = $this->Dbo->conditions(array('title LIKE' => '%hello'));
|
||||||
$expected = " WHERE `title` LIKE '%hello'";
|
$expected = " WHERE `title` LIKE '%hello'";
|
||||||
|
@ -2279,7 +2279,7 @@ class MysqlTest extends CakeTestCase {
|
||||||
$conditions = array('MysqlModel.id' => '');
|
$conditions = array('MysqlModel.id' => '');
|
||||||
$result = $this->Dbo->conditions($conditions, true, true, $this->model);
|
$result = $this->Dbo->conditions($conditions, true, true, $this->model);
|
||||||
$expected = " WHERE `MysqlModel`.`id` IS NULL";
|
$expected = " WHERE `MysqlModel`.`id` IS NULL";
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Dbo->conditions(array('Listing.beds >=' => 0));
|
$result = $this->Dbo->conditions(array('Listing.beds >=' => 0));
|
||||||
$expected = " WHERE `Listing`.`beds` >= 0";
|
$expected = " WHERE `Listing`.`beds` >= 0";
|
||||||
|
|
|
@ -272,7 +272,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
array('User' => array('user' => 'mariano'), 'Article' => array('published' => 'Y')),
|
array('User' => array('user' => 'mariano'), 'Article' => array('published' => 'Y')),
|
||||||
array('User' => array('user' => 'nate'), 'Article' => array('published' => ''))
|
array('User' => array('user' => 'nate'), 'Article' => array('published' => ''))
|
||||||
);
|
);
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7561,7 +7561,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'2' => 'Second Post',
|
'2' => 'Second Post',
|
||||||
'1' => 'First Post'
|
'1' => 'First Post'
|
||||||
);
|
);
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $Post->find('list', array('order' => array('Post.other_field' => 'DESC')));
|
$result = $Post->find('list', array('order' => array('Post.other_field' => 'DESC')));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -7569,23 +7569,23 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'2' => 'Second Post',
|
'2' => 'Second Post',
|
||||||
'3' => 'Third Post'
|
'3' => 'Third Post'
|
||||||
);
|
);
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$Post->Author->virtualFields = array('joined' => 'Post.id * Author.id');
|
$Post->Author->virtualFields = array('joined' => 'Post.id * Author.id');
|
||||||
$result = $Post->find('all');
|
$result = $Post->find('all');
|
||||||
$result = Set::extract('{n}.Author.joined', $result);
|
$result = Set::extract('{n}.Author.joined', $result);
|
||||||
$expected = array(1, 6, 3);
|
$expected = array(1, 6, 3);
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $Post->find('all', array('order' => array('Author.joined' => 'ASC')));
|
$result = $Post->find('all', array('order' => array('Author.joined' => 'ASC')));
|
||||||
$result = Set::extract('{n}.Author.joined', $result);
|
$result = Set::extract('{n}.Author.joined', $result);
|
||||||
$expected = array(1, 3, 6);
|
$expected = array(1, 3, 6);
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $Post->find('all', array('order' => array('Author.joined' => 'DESC')));
|
$result = $Post->find('all', array('order' => array('Author.joined' => 'DESC')));
|
||||||
$result = Set::extract('{n}.Author.joined', $result);
|
$result = Set::extract('{n}.Author.joined', $result);
|
||||||
$expected = array(6, 3, 1);
|
$expected = array(6, 3, 1);
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -149,7 +149,7 @@ class RouterTest extends CakeTestCase {
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
'[method]' => 'GET'
|
'[method]' => 'GET'
|
||||||
);
|
);
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
$this->assertEquals($resources, array('test_plugin'));
|
$this->assertEquals($resources, array('test_plugin'));
|
||||||
|
|
||||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||||
|
@ -163,7 +163,7 @@ class RouterTest extends CakeTestCase {
|
||||||
'id' => '13',
|
'id' => '13',
|
||||||
'[method]' => 'GET'
|
'[method]' => 'GET'
|
||||||
);
|
);
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -189,7 +189,7 @@ class RouterTest extends CakeTestCase {
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
'[method]' => 'GET'
|
'[method]' => 'GET'
|
||||||
);
|
);
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
$this->assertEquals($resources, array('test_plugin'));
|
$this->assertEquals($resources, array('test_plugin'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue