Merge branch '4.4' into 5.0
* 4.4: [Validator] fix merge
This commit is contained in:
commit
270d204750
@ -16,19 +16,16 @@ use Symfony\Component\Translation\IdentityTranslator;
|
|||||||
use Symfony\Component\Validator\Constraints\Valid;
|
use Symfony\Component\Validator\Constraints\Valid;
|
||||||
use Symfony\Component\Validator\ConstraintViolation;
|
use Symfony\Component\Validator\ConstraintViolation;
|
||||||
use Symfony\Component\Validator\ConstraintViolationList;
|
use Symfony\Component\Validator\ConstraintViolationList;
|
||||||
use Symfony\Component\Validator\Test\ForwardCompatTestTrait;
|
|
||||||
use Symfony\Component\Validator\Violation\ConstraintViolationBuilder;
|
use Symfony\Component\Validator\Violation\ConstraintViolationBuilder;
|
||||||
|
|
||||||
class ConstraintViolationBuilderTest extends TestCase
|
class ConstraintViolationBuilderTest extends TestCase
|
||||||
{
|
{
|
||||||
use ForwardCompatTestTrait;
|
|
||||||
|
|
||||||
private $root;
|
private $root;
|
||||||
private $violations;
|
private $violations;
|
||||||
private $messageTemplate = '%value% is invalid';
|
private $messageTemplate = '%value% is invalid';
|
||||||
private $builder;
|
private $builder;
|
||||||
|
|
||||||
private function doSetUp()
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
$this->root = [
|
$this->root = [
|
||||||
'data' => [
|
'data' => [
|
||||||
@ -69,10 +66,10 @@ class ConstraintViolationBuilderTest extends TestCase
|
|||||||
public function testCodeCanBeSet()
|
public function testCodeCanBeSet()
|
||||||
{
|
{
|
||||||
$this->builder
|
$this->builder
|
||||||
->setCode(5)
|
->setCode('5')
|
||||||
->addViolation();
|
->addViolation();
|
||||||
|
|
||||||
$this->assertViolationEquals(new ConstraintViolation($this->messageTemplate, $this->messageTemplate, [], $this->root, 'data', 'foo', null, 5, new Valid()));
|
$this->assertViolationEquals(new ConstraintViolation($this->messageTemplate, $this->messageTemplate, [], $this->root, 'data', 'foo', null, '5', new Valid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCauseCanBeSet()
|
public function testCauseCanBeSet()
|
||||||
|
Reference in New Issue
Block a user