Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 0% |
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 | public function configurePipeline(): void |
||
18 | { |
||
19 | parent::configurePipeline(); |
||
20 | $this->registerReplaceEntitiesNamespaceProcess(); |
||
21 | $this->registerEntityReplaceName($this->getEntityFqn()); |
||
22 | } |
||
23 | |||
24 | protected function registerReplaceEntitiesNamespaceProcess(): void |
||
25 | { |
||
26 | $process = new ReplaceEntitiesSubNamespaceProcess(); |
||
27 | $process->setProjectRootNamespace($this->projectRootNamespace); |
||
|
|||
28 | $process->setEntityFqn($this->getEntityFqn()); |
||
29 | $this->pipeline->register($process); |
||
30 | } |
||
31 | |||
32 | private function getEntityFqn(): string |
||
33 | { |
||
34 | return $this->entityFqn ?? $this->namespaceHelper->getEntityFqnFromEntityTestFqn($this->newObjectFqn); |
||
35 | } |
||
36 | |||
37 | public function setNewObjectFqnFromEntityFqn(string $entityFqn): self |
||
43 | } |
||
44 | } |
||
45 |