diff --git a/tests/php/UniqueKey/Mountain.php b/tests/php/UniqueKey/Mountain.php new file mode 100644 index 00000000000..205f599041d --- /dev/null +++ b/tests/php/UniqueKey/Mountain.php @@ -0,0 +1,21 @@ + 'Varchar', + ]; +} diff --git a/tests/php/UniqueKey/River.php b/tests/php/UniqueKey/River.php new file mode 100644 index 00000000000..7710e8203c9 --- /dev/null +++ b/tests/php/UniqueKey/River.php @@ -0,0 +1,21 @@ + 'Varchar', + ]; +} diff --git a/tests/php/UniqueKey/ServiceTest.php b/tests/php/UniqueKey/ServiceTest.php index a063d047513..051037f227c 100644 --- a/tests/php/UniqueKey/ServiceTest.php +++ b/tests/php/UniqueKey/ServiceTest.php @@ -4,7 +4,6 @@ use SilverStripe\Core\Extensible; use SilverStripe\Dev\SapphireTest; -use SilverStripe\ORM\Tests\DataObjectTest; class ServiceTest extends SapphireTest { @@ -17,8 +16,8 @@ class ServiceTest extends SapphireTest * @var array */ protected static $extra_dataobjects = array( - DataObjectTest\Team::class, - DataObjectTest\Player::class, + River::class, + Mountain::class, ); /** @@ -41,14 +40,14 @@ public function testUniqueKey(string $identifier, string $class, bool $extraKeys public function uniqueKeysProvider(): array { return [ - ['team1', DataObjectTest\Team::class, false, 'ss-Team-1-a4ec237d518051effd373f90dad9a1e2'], - ['team1', DataObjectTest\Team::class, true, 'ss-Team-1-acfce8862f3886ae67ed98d4306cec36'], - ['team2', DataObjectTest\Team::class, false, 'ss-Team-2-69de0ff334cf4687a528c2dbbe198d7d'], - ['team2', DataObjectTest\Team::class, true, 'ss-Team-2-82e2d95b464aa098572aec204f559101'], - ['captain1', DataObjectTest\Player::class, false, 'ss-Player-1-8fdb4b4c871b413daa017f89e43aadd5'], - ['captain1', DataObjectTest\Player::class, true, 'ss-Player-1-0ebd4a3ed29824276ded856c5e604715'], - ['captain2', DataObjectTest\Player::class, false, 'ss-Player-2-096c7afa2396936b75e045a27b708f8b'], - ['captain2', DataObjectTest\Player::class, true, 'ss-Player-2-a1299ef5c9a4032819f3a052bbea9f42'], + ['river1', River::class, false, 'ss-River-1-7eab00006ab6d090635b03f9fa1187d7'], + ['river1', River::class, true, 'ss-River-1-65474ab87fd42ca8cbfc32f87d5840e7'], + ['river2', River::class, false, 'ss-River-2-9c63d549d3a7a2f9679f7ce0dbb6a177'], + ['river2', River::class, true, 'ss-River-2-a028c9b5ecd2dd68edc6f20192e29c63'], + ['mountain1', Mountain::class, false, 'ss-Mountain-1-013d8ba56604ceeb2bda4b09d04c7e29'], + ['mountain1', Mountain::class, true, 'ss-Mountain-1-3dba35f13a9d3ad648be466946297444'], + ['mountain2', Mountain::class, false, 'ss-Mountain-2-a628f2db748065729d6a832a094cea3f'], + ['mountain2', Mountain::class, true, 'ss-Mountain-2-e6236799ab5a00d36ee704fa87d46021'], ]; } } diff --git a/tests/php/UniqueKey/ServiceTest.yml b/tests/php/UniqueKey/ServiceTest.yml index c297301c725..e9d9cf66c2f 100644 --- a/tests/php/UniqueKey/ServiceTest.yml +++ b/tests/php/UniqueKey/ServiceTest.yml @@ -1,13 +1,11 @@ -SilverStripe\ORM\Tests\DataObjectTest\Team: - team1: - Title: Team 1 - team2: - Title: Team 2 +SilverStripe\Tests\UniqueKey\River: + river1: + Title: BigRiver + river2: + Title: SmallRiver -SilverStripe\ORM\Tests\DataObjectTest\Player: - captain1: - FirstName: Captain - Surname: Zookeeper - captain2: - FirstName: Captain 2 - Surname: Aaron +SilverStripe\Tests\UniqueKey\Mountain: + mountain1: + Title: BigMountain + mountain2: + Title: SmallMountain