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\Controllers\Providers\Decorators\UniqueProviderDecorator; |
8
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\BaseProvider; |
9
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\CachedProvider; |
10
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\DecoratedProvider; |
11
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Tests\Api\AddGenerator; |
12
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Tests\Api\Providers\Decorators\EntityDataDecorator; |
13
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
14
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
15
|
|
|
|
16
|
|
|
final class AddTestCommand extends AbstractApiCommand |
17
|
|
|
{ |
18
|
|
|
protected function configure() |
19
|
|
|
{ |
20
|
|
|
parent::configure(); |
21
|
|
|
$this->setName('generate:test:api:add') |
22
|
|
|
->setDescription('Add Api Test for add action.') |
23
|
|
|
->setHelp('This command creates the Codeception Api Test for Add Action for given entity.'); |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* {@inheritdoc} |
28
|
|
|
* @param InputInterface $input |
29
|
|
|
* @param OutputInterface $output |
30
|
|
|
* @throws \Twig_Error_Loader |
31
|
|
|
* @throws \Twig_Error_Runtime |
32
|
|
|
* @throws \Twig_Error_Syntax |
33
|
|
|
*/ |
34
|
|
|
protected function execute(InputInterface $input, OutputInterface $output) |
35
|
|
|
{ |
36
|
|
|
$baseProvider = new BaseProvider($this->entityClassName); |
37
|
|
|
|
38
|
|
|
$generator = new AddGenerator( |
39
|
|
|
new CachedProvider( |
40
|
|
|
new DecoratedProvider( |
41
|
|
|
$baseProvider, |
42
|
|
|
new UniqueProviderDecorator($this->entityClassName), |
43
|
|
|
new EntityDataDecorator($this->entityClassName) |
44
|
|
|
) |
45
|
|
|
) |
46
|
|
|
); |
47
|
|
|
$this->writer->write($generator->generate(), $generator->getFileName()); |
|
|
|
|
48
|
|
|
|
49
|
|
|
parent::execute($input, $output); |
50
|
|
|
} |
51
|
|
|
} |
52
|
|
|
|
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.