[Validator] Renamed validateCollection() to validateObjects()
This commit is contained in:
parent
df41974f31
commit
e440690bb4
@ -59,9 +59,9 @@ abstract class Abstract2Dot5ApiTest extends AbstractValidatorTest
|
||||
return $this->validator->validateObject($object, $groups);
|
||||
}
|
||||
|
||||
protected function validateCollection($collection, $groups = null, $deep = false)
|
||||
protected function validateObjects($objects, $groups = null, $deep = false)
|
||||
{
|
||||
return $this->validator->validateCollection($collection, $groups, $deep);
|
||||
return $this->validator->validateObjects($objects, $groups, $deep);
|
||||
}
|
||||
|
||||
protected function validateProperty($object, $propertyName, $groups = null)
|
||||
@ -276,7 +276,7 @@ abstract class Abstract2Dot5ApiTest extends AbstractValidatorTest
|
||||
->getValidator()
|
||||
->inContext($context)
|
||||
->atPath('subpath')
|
||||
->validateCollection(array('key' => $value->reference))
|
||||
->validateObjects(array('key' => $value->reference))
|
||||
;
|
||||
};
|
||||
|
||||
|
@ -57,9 +57,9 @@ abstract class AbstractLegacyApiTest extends AbstractValidatorTest
|
||||
return $this->validator->validate($object, $groups);
|
||||
}
|
||||
|
||||
protected function validateCollection($collection, $groups = null, $deep = false)
|
||||
protected function validateObjects($objects, $groups = null, $deep = false)
|
||||
{
|
||||
return $this->validator->validate($collection, $groups, true, $deep);
|
||||
return $this->validator->validate($objects, $groups, true, $deep);
|
||||
}
|
||||
|
||||
protected function validateProperty($object, $propertyName, $groups = null)
|
||||
|
@ -67,7 +67,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
abstract protected function validateObject($object, $groups = null);
|
||||
|
||||
abstract protected function validateCollection($collection, $groups = null, $deep = false);
|
||||
abstract protected function validateObjects($objects, $groups = null, $deep = false);
|
||||
|
||||
abstract protected function validateProperty($object, $propertyName, $groups = null);
|
||||
|
||||
@ -249,7 +249,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
'groups' => 'Group',
|
||||
)));
|
||||
|
||||
$violations = $this->validateCollection($array, 'Group');
|
||||
$violations = $this->validateObjects($array, 'Group');
|
||||
|
||||
/** @var ConstraintViolationInterface[] $violations */
|
||||
$this->assertCount(1, $violations);
|
||||
@ -287,7 +287,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
'groups' => 'Group',
|
||||
)));
|
||||
|
||||
$violations = $this->validateCollection($array, 'Group');
|
||||
$violations = $this->validateObjects($array, 'Group');
|
||||
|
||||
/** @var ConstraintViolationInterface[] $violations */
|
||||
$this->assertCount(1, $violations);
|
||||
@ -325,7 +325,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
'groups' => 'Group',
|
||||
)));
|
||||
|
||||
$violations = $this->validateCollection($traversable, 'Group');
|
||||
$violations = $this->validateObjects($traversable, 'Group');
|
||||
|
||||
/** @var ConstraintViolationInterface[] $violations */
|
||||
$this->assertCount(1, $violations);
|
||||
@ -359,7 +359,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
'groups' => 'Group',
|
||||
)));
|
||||
|
||||
$this->validateCollection($traversable, 'Group');
|
||||
$this->validateObjects($traversable, 'Group');
|
||||
}
|
||||
|
||||
public function testRecursiveTraversableRecursiveTraversalEnabled()
|
||||
@ -388,7 +388,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
'groups' => 'Group',
|
||||
)));
|
||||
|
||||
$violations = $this->validateCollection($traversable, 'Group', true);
|
||||
$violations = $this->validateObjects($traversable, 'Group', true);
|
||||
|
||||
/** @var ConstraintViolationInterface[] $violations */
|
||||
$this->assertCount(1, $violations);
|
||||
|
@ -110,14 +110,14 @@ class ContextualValidator implements ContextualValidatorInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function validateCollection($collection, $groups = null, $deep = false)
|
||||
public function validateObjects($objects, $groups = null, $deep = false)
|
||||
{
|
||||
$constraint = new Traverse(array(
|
||||
'traverse' => true,
|
||||
'deep' => $deep,
|
||||
));
|
||||
|
||||
return $this->validate($collection, $constraint, $groups);
|
||||
return $this->validate($objects, $constraint, $groups);
|
||||
}
|
||||
|
||||
public function validateProperty($object, $propertyName, $groups = null)
|
||||
|
@ -51,7 +51,7 @@ interface ContextualValidatorInterface
|
||||
*/
|
||||
public function validateObject($object, $groups = null);
|
||||
|
||||
public function validateCollection($collection, $groups = null, $deep = false);
|
||||
public function validateObjects($objects, $groups = null, $deep = false);
|
||||
|
||||
/**
|
||||
* Validates a property of a value against its current value.
|
||||
|
@ -98,10 +98,10 @@ class Validator implements ValidatorInterface
|
||||
->getViolations();
|
||||
}
|
||||
|
||||
public function validateCollection($collection, $groups = null, $deep = false)
|
||||
public function validateObjects($objects, $groups = null, $deep = false)
|
||||
{
|
||||
return $this->startContext($collection)
|
||||
->validateCollection($collection, $groups, $deep)
|
||||
return $this->startContext($objects)
|
||||
->validateObjects($objects, $groups, $deep)
|
||||
->getViolations();
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ interface ValidatorInterface
|
||||
*/
|
||||
public function validateObject($object, $groups = null);
|
||||
|
||||
public function validateCollection($collection, $groups = null, $deep = false);
|
||||
public function validateObjects($objects, $groups = null, $deep = false);
|
||||
|
||||
/**
|
||||
* Validates a property of a value against its current value.
|
||||
|
Reference in New Issue
Block a user