edmondscommerce /
doctrine-static-meta
| 1 | <?php declare(strict_types=1); |
||
| 2 | |||
| 3 | namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Large\Entity\Fields\Traits\PrimaryKey; |
||
| 4 | |||
| 5 | use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Generator\Field\IdTrait; |
||
| 6 | use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Interfaces\PrimaryKey\IdFieldInterface; |
||
| 7 | use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Traits\PrimaryKey\NonBinaryUuidFieldTrait; |
||
| 8 | use EdmondsCommerce\DoctrineStaticMeta\Tests\Assets\AbstractTest; |
||
| 9 | use Ramsey\Uuid\UuidInterface; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @covers \EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Traits\PrimaryKey\UuidFieldTrait |
||
| 13 | * @SuppressWarnings(PHPMD.DepthOfInheritance) |
||
| 14 | */ |
||
| 15 | class NonBinaryUuidFieldTraitTest extends IdFieldTraitTest |
||
| 16 | { |
||
| 17 | public const WORK_DIR = AbstractTest::VAR_PATH . |
||
| 18 | '/' . |
||
| 19 | self::TEST_TYPE_LARGE . |
||
| 20 | '/NonBinaryUuidFieldTraitTest/'; |
||
| 21 | protected const TEST_FIELD_FQN = NonBinaryUuidFieldTrait::class; |
||
| 22 | protected const TEST_FIELD_PROP = IdFieldInterface::PROP_ID; |
||
| 23 | protected const VALIDATES = false; |
||
| 24 | |||
| 25 | public function generateCode() |
||
| 26 | { |
||
| 27 | $this->getEntityGenerator() |
||
|
0 ignored issues
–
show
Deprecated Code
introduced
by
Loading history...
|
|||
| 28 | ->setPrimaryKeyType(IdTrait::NON_BINARY_UUID_TRAIT) |
||
| 29 | ->generateEntity(static::TEST_ENTITY_FQN_BASE . $this->entitySuffix); |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function validateSavedEntity($entity) |
||
| 33 | { |
||
| 34 | $id = $entity->getId(); |
||
| 35 | self::assertNotEmpty($id); |
||
| 36 | self::assertInstanceOf(UuidInterface::class, $id); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |