ソースを参照

All Marshaller tests finally fixed :)

Jose Lorenzo Rodriguez 11 年 前
コミット
c9f2fe9fd4

+ 1 - 1
src/ORM/Table.php

@@ -1646,7 +1646,7 @@ class Table implements RepositoryInterface, EventListener {
 			$options['associated'] = $this->_associations->keys();
 		}
 		$marshaller = $this->marshaller();
-		return $marshaller->mergeMany($entities, $data, $associations);
+		return $marshaller->mergeMany($entities, $data, $options);
 	}
 
 /**

+ 4 - 5
tests/TestCase/ORM/QueryRegressionTest.php

@@ -226,14 +226,13 @@ class QueryRegressionTest extends TestCase {
 				]
 			]
 		];
-		$entity = $articles->patchEntity($entity, $data, [
-			'Highlights._joinData.Authors', 'Highlights.Authors'
-		]);
-		$articles->save($entity, [
+		$options = [
 			'associated' => [
 				'Highlights._joinData.Authors', 'Highlights.Authors'
 			]
-		]);
+		];
+		$entity = $articles->patchEntity($entity, $data, $options);
+		$articles->save($entity, $options);
 		$entity = $articles->get(2, [
 			'contain' => [
 				'SpecialTags' => ['sort' => ['SpecialTags.id' => 'ASC']],

+ 2 - 2
tests/TestCase/ORM/TableTest.php

@@ -3352,7 +3352,7 @@ class TableTest extends \Cake\TestSuite\TestCase {
 		$data = ['foo' => 'bar'];
 		$marshaller->expects($this->once())
 			->method('merge')
-			->with($entity, $data, ['users', 'articles'])
+			->with($entity, $data, ['associated' => ['users', 'articles']])
 			->will($this->returnValue($entity));
 		$table->patchEntity($entity, $data);
 	}
@@ -3375,7 +3375,7 @@ class TableTest extends \Cake\TestSuite\TestCase {
 		$data = [['foo' => 'bar']];
 		$marshaller->expects($this->once())
 			->method('mergeMany')
-			->with($entities, $data, ['users', 'articles'])
+			->with($entities, $data, ['associated' => ['users', 'articles']])
 			->will($this->returnValue($entities));
 		$table->patchEntities($entities, $data);
 	}