| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 8 | class EntityTestCreator extends AbstractCreator |
||
| 9 | { |
||
| 10 | public const FIND_NAME = 'TemplateEntityTest'; |
||
| 11 | public const TEMPLATE_PATH = self::ROOT_TEMPLATE_PATH . '/tests/Entities/' . self::FIND_NAME . '.php'; |
||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private $entityFqn; |
||
| 16 | |||
| 17 | 4 | public function configurePipeline(): void |
|
| 18 | { |
||
| 19 | 4 | parent::configurePipeline(); |
|
| 20 | 4 | $this->registerReplaceEntitiesNamespaceProcess(); |
|
| 21 | 4 | $this->registerEntityReplaceName($this->getEntityFqn()); |
|
| 22 | 4 | } |
|
| 23 | |||
| 24 | 4 | protected function registerReplaceEntitiesNamespaceProcess(): void |
|
| 25 | { |
||
| 26 | 4 | $process = new ReplaceEntitiesSubNamespaceProcess(); |
|
| 27 | 4 | $process->setEntityFqn($this->getEntityFqn()); |
|
| 28 | 4 | $this->pipeline->register($process); |
|
| 29 | 4 | } |
|
| 30 | |||
| 31 | 4 | private function getEntityFqn(): string |
|
| 32 | { |
||
| 33 | 4 | return $this->entityFqn ?? $this->namespaceHelper->getEntityFqnFromEntityTestFqn($this->newObjectFqn); |
|
| 34 | } |
||
| 35 | |||
| 36 | 2 | public function setNewObjectFqnFromEntityFqn(string $entityFqn): self |
|
| 42 | } |
||
| 43 | } |
||
| 44 |