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\IntegerIdFieldTrait; |
||
| 8 | use EdmondsCommerce\DoctrineStaticMeta\Tests\Assets\AbstractTest; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @covers \EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Traits\PrimaryKey\IntegerIdFieldTrait |
||
| 12 | * @SuppressWarnings(PHPMD.DepthOfInheritance) |
||
| 13 | */ |
||
| 14 | class IntegerIdFieldTraitTest extends IdFieldTraitTest |
||
| 15 | { |
||
| 16 | public const WORK_DIR = AbstractTest::VAR_PATH . |
||
| 17 | '/' . |
||
| 18 | self::TEST_TYPE_LARGE . |
||
| 19 | '/IntegerIdFieldTraitTest/'; |
||
| 20 | protected const TEST_FIELD_FQN = IntegerIdFieldTrait::class; |
||
| 21 | protected const TEST_FIELD_PROP = IdFieldInterface::PROP_ID; |
||
| 22 | protected const VALIDATES = false; |
||
| 23 | |||
| 24 | public function generateCode() |
||
| 25 | { |
||
| 26 | $this->getEntityGenerator() |
||
|
0 ignored issues
–
show
Deprecated Code
introduced
by
Loading history...
|
|||
| 27 | ->setPrimaryKeyType(IdTrait::INTEGER_ID_FIELD_TRAIT) |
||
| 28 | ->generateEntity(static::TEST_ENTITY_FQN_BASE . $this->entitySuffix); |
||
| 29 | } |
||
| 30 | |||
| 31 | protected function validateSavedEntity($entity) |
||
| 32 | { |
||
| 33 | $id = $entity->getId(); |
||
| 34 | self::assertNotEmpty($id); |
||
| 35 | self::assertInternalType('int', $id); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |