ソースを参照

Replace validateValue by validate in inline edit

Emmanuel Vella 10 年 前
コミット
f0e097307e

+ 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))
         ;