"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

UniqueEntityValidatorTest.php  (phplist-3.4.5.tgz):UniqueEntityValidatorTest.php  (phplist-3.4.6.tgz)
skipping to change at line 278 skipping to change at line 278
$this->buildViolation('myMessage') $this->buildViolation('myMessage')
->atPath('property.path.name') ->atPath('property.path.name')
->setParameter('{{ value }}', '"Foo"') ->setParameter('{{ value }}', '"Foo"')
->setInvalidValue('Foo') ->setInvalidValue('Foo')
->setCause([$entity1]) ->setCause([$entity1])
->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
->assertRaised(); ->assertRaised();
} }
/**
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefin
itionException
*/
public function testAllConfiguredFieldsAreCheckedOfBeingMappedByDoctrineWith IgnoreNullEnabled() public function testAllConfiguredFieldsAreCheckedOfBeingMappedByDoctrineWith IgnoreNullEnabled()
{ {
$this->expectException('Symfony\Component\Validator\Exception\Constraint DefinitionException');
$constraint = new UniqueEntity([ $constraint = new UniqueEntity([
'message' => 'myMessage', 'message' => 'myMessage',
'fields' => ['name', 'name2'], 'fields' => ['name', 'name2'],
'em' => self::EM_NAME, 'em' => self::EM_NAME,
'ignoreNull' => true, 'ignoreNull' => true,
]); ]);
$entity1 = new SingleIntIdEntity(1, null); $entity1 = new SingleIntIdEntity(1, null);
$this->validator->validate($entity1, $constraint); $this->validator->validate($entity1, $constraint);
skipping to change at line 589 skipping to change at line 587
$this->buildViolation('myMessage') $this->buildViolation('myMessage')
->atPath('property.path.phoneNumbers') ->atPath('property.path.phoneNumbers')
->setParameter('{{ value }}', 'array') ->setParameter('{{ value }}', 'array')
->setInvalidValue([123]) ->setInvalidValue([123])
->setCause([$entity1]) ->setCause([$entity1])
->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
->assertRaised(); ->assertRaised();
} }
/**
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefin
itionException
* @expectedExceptionMessage Object manager "foo" does not exist.
*/
public function testDedicatedEntityManagerNullObject() public function testDedicatedEntityManagerNullObject()
{ {
$this->expectException('Symfony\Component\Validator\Exception\Constraint
DefinitionException');
$this->expectExceptionMessage('Object manager "foo" does not exist.');
$constraint = new UniqueEntity([ $constraint = new UniqueEntity([
'message' => 'myMessage', 'message' => 'myMessage',
'fields' => ['name'], 'fields' => ['name'],
'em' => self::EM_NAME, 'em' => self::EM_NAME,
]); ]);
$this->em = null; $this->em = null;
$this->registry = $this->createRegistryMock($this->em); $this->registry = $this->createRegistryMock($this->em);
$this->validator = $this->createValidator(); $this->validator = $this->createValidator();
$this->validator->initialize($this->context); $this->validator->initialize($this->context);
$entity = new SingleIntIdEntity(1, null); $entity = new SingleIntIdEntity(1, null);
$this->validator->validate($entity, $constraint); $this->validator->validate($entity, $constraint);
} }
/**
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefin
itionException
* @expectedExceptionMessage Unable to find the object manager associated wi
th an entity of class "Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity"
*/
public function testEntityManagerNullObject() public function testEntityManagerNullObject()
{ {
$this->expectException('Symfony\Component\Validator\Exception\Constraint
DefinitionException');
$this->expectExceptionMessage('Unable to find the object manager associa
ted with an entity of class "Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdE
ntity"');
$constraint = new UniqueEntity([ $constraint = new UniqueEntity([
'message' => 'myMessage', 'message' => 'myMessage',
'fields' => ['name'], 'fields' => ['name'],
// no "em" option set // no "em" option set
]); ]);
$this->em = null; $this->em = null;
$this->registry = $this->createRegistryMock($this->em); $this->registry = $this->createRegistryMock($this->em);
$this->validator = $this->createValidator(); $this->validator = $this->createValidator();
$this->validator->initialize($this->context); $this->validator->initialize($this->context);
skipping to change at line 695 skipping to change at line 689
$this->buildViolation('myMessage') $this->buildViolation('myMessage')
->atPath('property.path.name') ->atPath('property.path.name')
->setInvalidValue('Foo') ->setInvalidValue('Foo')
->setCode('23bd9dbf-6b9b-41cd-a99e-4844bcf3077f') ->setCode('23bd9dbf-6b9b-41cd-a99e-4844bcf3077f')
->setCause([$entity1]) ->setCause([$entity1])
->setParameters(['{{ value }}' => '"Foo"']) ->setParameters(['{{ value }}' => '"Foo"'])
->assertRaised(); ->assertRaised();
} }
/**
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefin
itionException
* @expectedExceptionMessage The "Symfony\Bridge\Doctrine\Tests\Fixtures\Sin
gleStringIdEntity" entity repository does not support the "Symfony\Bridge\Doctri
ne\Tests\Fixtures\Person" entity. The entity should be an instance of or extend
"Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity".
*/
public function testInvalidateRepositoryForInheritance() public function testInvalidateRepositoryForInheritance()
{ {
$this->expectException('Symfony\Component\Validator\Exception\Constraint
DefinitionException');
$this->expectExceptionMessage('The "Symfony\Bridge\Doctrine\Tests\Fixtur
es\SingleStringIdEntity" entity repository does not support the "Symfony\Bridge\
Doctrine\Tests\Fixtures\Person" entity. The entity should be an instance of or e
xtend "Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity".');
$constraint = new UniqueEntity([ $constraint = new UniqueEntity([
'message' => 'myMessage', 'message' => 'myMessage',
'fields' => ['name'], 'fields' => ['name'],
'em' => self::EM_NAME, 'em' => self::EM_NAME,
'entityClass' => 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStrin gIdEntity', 'entityClass' => 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStrin gIdEntity',
]); ]);
$entity = new Person(1, 'Foo'); $entity = new Person(1, 'Foo');
$this->validator->validate($entity, $constraint); $this->validator->validate($entity, $constraint);
} }
 End of changes. 8 change blocks. 
23 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)