mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 03:22:39 +00:00
parent
1c0b6c076a
commit
5e680cb292
1 changed files with 28 additions and 0 deletions
|
@ -531,6 +531,34 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that saving only some of the translated fields allows the record to be found again.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testSavePartialFields() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
$TestModel->locale = 'spa';
|
||||
$data = array(
|
||||
'slug' => 'fourth_translated',
|
||||
'title' => 'Leyenda #4',
|
||||
);
|
||||
$TestModel->create($data);
|
||||
$TestModel->save();
|
||||
$result = $TestModel->read();
|
||||
$expected = array(
|
||||
'TranslatedItem' => array(
|
||||
'id' => $TestModel->id,
|
||||
'translated_article_id' => null,
|
||||
'locale' => 'spa',
|
||||
'content' => '',
|
||||
) + $data
|
||||
);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testSaveUpdate method
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue