mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-07 20:12:42 +00:00
Merge branch 'master' into 2.5
This commit is contained in:
commit
c093804b35
8 changed files with 95 additions and 17 deletions
|
@ -275,6 +275,40 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testLocaleSingleCountWithConditions method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testLocaleSingleCountWithConditions() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
$TestModel->locale = 'eng';
|
||||
$result = $TestModel->find('all', array(
|
||||
'conditions' => array('slug' => 'first_translated')
|
||||
));
|
||||
$expected = array(
|
||||
array(
|
||||
'TranslatedItem' => array(
|
||||
'id' => 1,
|
||||
'slug' => 'first_translated',
|
||||
'locale' => 'eng',
|
||||
'title' => 'Title #1',
|
||||
'content' => 'Content #1',
|
||||
'translated_article_id' => 1,
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$result = $TestModel->find('count', array(
|
||||
'conditions' => array('slug' => 'first_translated')
|
||||
));
|
||||
$expected = 1;
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testLocaleSingleAssociations method
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue