1
0
mirror of synced 2025-02-02 21:41:45 +03:00

When invalid (null) identifiers are provided, an exception should be thrown

This commit is contained in:
Marco Pivetta 2016-07-07 20:08:24 +02:00
parent 9abccba109
commit 5b8b548bd4

View File

@ -447,35 +447,19 @@ class UnitOfWorkTest extends OrmTestCase
public function entitiesWithInvalidIdentifiersProvider() public function entitiesWithInvalidIdentifiersProvider()
{ {
$emptyString = new EntityWithStringIdentifier(); $firstNullString = new EntityWithCompositeStringIdentifier();
$emptyString->id = ''; $firstNullString->id2 = uniqid('id2', true);
$nonEmptyString = new EntityWithStringIdentifier(); $secondNullString = new EntityWithCompositeStringIdentifier();
$nonEmptyString->id = uniqid('id', true); $secondNullString->id1 = uniqid('id1', true);
$emptyStrings = new EntityWithCompositeStringIdentifier();
$emptyStrings->id1 = '';
$emptyStrings->id2 = '';
$nonEmptyStrings = new EntityWithCompositeStringIdentifier();
$nonEmptyStrings->id1 = uniqid('id1', true);
$nonEmptyStrings->id2 = uniqid('id2', true);
$booleanTrue = new EntityWithBooleanIdentifier();
$booleanTrue->id = true;
$booleanFalse = new EntityWithBooleanIdentifier();
$booleanFalse->id = false;
return [ return [
'null string, single field' => [new EntityWithStringIdentifier()], 'null string, single field' => [new EntityWithStringIdentifier()],
'null strings, two fieldds' => [new EntityWithCompositeStringIdentifier()], 'null strings, two fields' => [new EntityWithCompositeStringIdentifier()],
'first null string, two fields' => [$firstNullString],
'second null string, two fields' => [$secondNullString],
]; ];
} }
} }