|
96 | 96 | use ApiPlatform\Tests\Fixtures\TestBundle\Document\SoMany as SoManyDocument; |
97 | 97 | use ApiPlatform\Tests\Fixtures\TestBundle\Document\Taxon as TaxonDocument; |
98 | 98 | use ApiPlatform\Tests\Fixtures\TestBundle\Document\ThirdLevel as ThirdLevelDocument; |
| 99 | +use ApiPlatform\Tests\Fixtures\TestBundle\Document\UidBasedId as UidBasedIdDocument; |
99 | 100 | use ApiPlatform\Tests\Fixtures\TestBundle\Document\UrlEncodedId as UrlEncodedIdDocument; |
100 | 101 | use ApiPlatform\Tests\Fixtures\TestBundle\Document\User as UserDocument; |
101 | 102 | use ApiPlatform\Tests\Fixtures\TestBundle\Document\VideoGame as VideoGameDocument; |
|
198 | 199 | use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Taxon; |
199 | 200 | use ApiPlatform\Tests\Fixtures\TestBundle\Entity\ThirdLevel; |
200 | 201 | use ApiPlatform\Tests\Fixtures\TestBundle\Entity\TreeDummy; |
| 202 | +use ApiPlatform\Tests\Fixtures\TestBundle\Entity\UidBasedId; |
201 | 203 | use ApiPlatform\Tests\Fixtures\TestBundle\Entity\UrlEncodedId; |
202 | 204 | use ApiPlatform\Tests\Fixtures\TestBundle\Entity\User; |
203 | 205 | use ApiPlatform\Tests\Fixtures\TestBundle\Entity\UuidIdentifierDummy; |
|
215 | 217 | use Doctrine\Persistence\ManagerRegistry; |
216 | 218 | use Doctrine\Persistence\ObjectManager; |
217 | 219 | use Ramsey\Uuid\Uuid; |
| 220 | +use Symfony\Component\Uid\Ulid; |
218 | 221 | use Symfony\Component\Uid\Uuid as SymfonyUuid; |
219 | 222 |
|
220 | 223 | /** |
@@ -1426,6 +1429,17 @@ public function thereIsAUrlEncodedIdResource(): void |
1426 | 1429 | $this->manager->clear(); |
1427 | 1430 | } |
1428 | 1431 |
|
| 1432 | + /** |
| 1433 | + * @Given there is a UidBasedId resource with id :id |
| 1434 | + */ |
| 1435 | + public function thereIsAUidBasedIdResource(string $id): void |
| 1436 | + { |
| 1437 | + $uidBasedIdResource = ($this->isOrm() ? new UidBasedId(Ulid::fromBase32($id)) : new UidBasedIdDocument(Ulid::fromBase32($id))); |
| 1438 | + $this->manager->persist($uidBasedIdResource); |
| 1439 | + $this->manager->flush(); |
| 1440 | + $this->manager->clear(); |
| 1441 | + } |
| 1442 | + |
1429 | 1443 | /** |
1430 | 1444 | * @Given there is a Program |
1431 | 1445 | */ |
|
0 commit comments