浏览代码

All Marshaller tests finally fixed :)

Jose Lorenzo Rodriguez 11 年之前
父节点
当前提交
c9f2fe9fd4
共有 3 个文件被更改,包括 7 次插入8 次删除
  1. 1 1
      src/ORM/Table.php
  2. 4 5
      tests/TestCase/ORM/QueryRegressionTest.php
  3. 2 2
      tests/TestCase/ORM/TableTest.php

+ 1 - 1
src/ORM/Table.php

@@ -1646,7 +1646,7 @@ class Table implements RepositoryInterface, EventListener {
 			$options['associated'] = $this->_associations->keys();
 			$options['associated'] = $this->_associations->keys();
 		}
 		}
 		$marshaller = $this->marshaller();
 		$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' => [
 			'associated' => [
 				'Highlights._joinData.Authors', 'Highlights.Authors'
 				'Highlights._joinData.Authors', 'Highlights.Authors'
 			]
 			]
-		]);
+		];
+		$entity = $articles->patchEntity($entity, $data, $options);
+		$articles->save($entity, $options);
 		$entity = $articles->get(2, [
 		$entity = $articles->get(2, [
 			'contain' => [
 			'contain' => [
 				'SpecialTags' => ['sort' => ['SpecialTags.id' => 'ASC']],
 				'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'];
 		$data = ['foo' => 'bar'];
 		$marshaller->expects($this->once())
 		$marshaller->expects($this->once())
 			->method('merge')
 			->method('merge')
-			->with($entity, $data, ['users', 'articles'])
+			->with($entity, $data, ['associated' => ['users', 'articles']])
 			->will($this->returnValue($entity));
 			->will($this->returnValue($entity));
 		$table->patchEntity($entity, $data);
 		$table->patchEntity($entity, $data);
 	}
 	}
@@ -3375,7 +3375,7 @@ class TableTest extends \Cake\TestSuite\TestCase {
 		$data = [['foo' => 'bar']];
 		$data = [['foo' => 'bar']];
 		$marshaller->expects($this->once())
 		$marshaller->expects($this->once())
 			->method('mergeMany')
 			->method('mergeMany')
-			->with($entities, $data, ['users', 'articles'])
+			->with($entities, $data, ['associated' => ['users', 'articles']])
 			->will($this->returnValue($entities));
 			->will($this->returnValue($entities));
 		$table->patchEntities($entities, $data);
 		$table->patchEntities($entities, $data);
 	}
 	}