1
0
mirror of synced 2025-02-03 05:49:25 +03:00

Non-empty composite key identifiers should also be supported

This commit is contained in:
Marco Pivetta 2016-07-07 19:35:39 +02:00
parent 549bfe127c
commit 29d9f344e8

View File

@ -393,17 +393,23 @@ class UnitOfWorkTest extends OrmTestCase
$nonEmptyString = new EntityWithStringIdentifier(); $nonEmptyString = new EntityWithStringIdentifier();
$nonEmptyString->id = uniqid('', true); $nonEmptyString->id = uniqid('id', true);
$emptyStrings = new EntityWithCompositeStringIdentifier(); $emptyStrings = new EntityWithCompositeStringIdentifier();
$emptyStrings->id1 = ''; $emptyStrings->id1 = '';
$emptyStrings->id2 = ''; $emptyStrings->id2 = '';
$nonEmptyStrings = new EntityWithCompositeStringIdentifier();
$nonEmptyStrings->id1 = uniqid('id1', true);
$nonEmptyStrings->id2 = uniqid('id2', true);
return [ return [
'empty string, single field' => [$emptyString, ''], 'empty string, single field' => [$emptyString, ''],
'non-empty string, single field' => [$nonEmptyString, $nonEmptyString->id], 'non-empty string, single field' => [$nonEmptyString, $nonEmptyString->id],
'empty strings, two fields' => [$emptyStrings, ' '], 'empty strings, two fields' => [$emptyStrings, ' '],
'non-empty strings, two fields' => [$nonEmptyStrings, $nonEmptyStrings->id1 . ' ' . $nonEmptyStrings->id2],
]; ];
} }
} }