1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace SlayerBirden\DFCodeGeneration\Command\Tests\Api; |
5
|
|
|
|
6
|
|
|
use SlayerBirden\DFCodeGeneration\Command\AbstractApiCommand; |
7
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Config\Providers\Decorators\EntityIdDecorator; |
8
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Controllers\Providers\Decorators\UniqueProviderDecorator; |
9
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\BaseProvider; |
10
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\CachedProvider; |
11
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\DecoratedProvider; |
12
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Tests\Api\AddGenerator; |
13
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Tests\Api\Providers\Decorators\EntityDataDecorator; |
14
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Tests\Api\ReflectionEntitySpecProvider; |
15
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
16
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
17
|
|
|
|
18
|
|
|
final class AddTestCommand extends AbstractApiCommand |
19
|
|
|
{ |
20
|
2 |
|
protected function configure() |
21
|
|
|
{ |
22
|
2 |
|
parent::configure(); |
23
|
2 |
|
$this->setName('test:api:add') |
24
|
2 |
|
->setDescription('Api Test for add action.') |
25
|
2 |
|
->setHelp('This command creates the Codeception Api Test for Add Action for given entity.'); |
26
|
2 |
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* {@inheritdoc} |
30
|
|
|
* @param InputInterface $input |
31
|
|
|
* @param OutputInterface $output |
32
|
|
|
* @throws \Twig_Error_Loader |
33
|
|
|
* @throws \Twig_Error_Runtime |
34
|
|
|
* @throws \Twig_Error_Syntax |
35
|
|
|
*/ |
36
|
2 |
|
protected function execute(InputInterface $input, OutputInterface $output) |
37
|
|
|
{ |
38
|
2 |
|
$baseProvider = new BaseProvider($this->entityClassName); |
39
|
|
|
|
40
|
2 |
|
$generator = new AddGenerator( |
41
|
2 |
|
new CachedProvider( |
42
|
2 |
|
new DecoratedProvider( |
43
|
2 |
|
$baseProvider, |
44
|
2 |
|
new UniqueProviderDecorator($this->entityClassName), |
45
|
2 |
|
new EntityDataDecorator( |
46
|
2 |
|
$this->entityClassName, |
47
|
2 |
|
new ReflectionEntitySpecProvider($this->entityClassName) |
48
|
|
|
), |
49
|
2 |
|
new EntityIdDecorator($this->entityClassName) |
50
|
|
|
) |
51
|
|
|
) |
52
|
|
|
); |
53
|
2 |
|
$this->writer->write($generator->generate(), $generator->getFileName()); |
|
|
|
|
54
|
|
|
|
55
|
2 |
|
parent::execute($input, $output); |
56
|
2 |
|
} |
57
|
|
|
} |
58
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.