浏览代码

Replace validateValue by validate in inline edit

Emmanuel Vella 10 年之前
父节点
当前提交
f0e097307e
共有 3 个文件被更改,包括 6 次插入3 次删除
  1. 3 0
      CHANGELOG.md
  2. 1 1
      Controller/HelperController.php
  3. 2 2
      Tests/Controller/HelperControllerTest.php

+ 3 - 0
CHANGELOG.md

@@ -1,6 +1,9 @@
 CHANGELOG
 =========
 
+### 2014-11-04
+ * [BC BREAK] Inline edition now validates the whole object.
+
 ### 2014-09-21
  * added new form type ``sonata_choice_field_mask``
 

+ 1 - 1
Controller/HelperController.php

@@ -272,7 +272,7 @@ class HelperController
 
         $propertyAccessor->setValue($object, $propertyPath, '' !== $value ? $value : null);
 
-        $violations = $this->validator->validateProperty($object, $field);
+        $violations = $this->validator->validate($object);
 
         if (count($violations)) {
             $messages = array();

+ 2 - 2
Tests/Controller/HelperControllerTest.php

@@ -428,8 +428,8 @@ class HelperControllerTest extends \PHPUnit_Framework_TestCase
         $validator = $this->getMock('Symfony\Component\Validator\ValidatorInterface');
         $validator
             ->expects($this->once())
-            ->method('validateProperty')
-            ->with($bar, 'enabled')
+            ->method('validate')
+            ->with($bar)
             ->will($this->returnValue($violations))
         ;