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