|
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\Config\Providers\Decorators\OwnerDecorator; |
|
9
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Controllers\Providers\Decorators\EntityNamePluralDecorator; |
|
10
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Controllers\Providers\Decorators\RelationsProviderDecorator; |
|
11
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\BaseProvider; |
|
12
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\CachedProvider; |
|
13
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\DecoratedProvider; |
|
14
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Tests\Api\GetsGenerator; |
|
15
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Tests\Api\Providers\Decorators\EntityDataDecorator; |
|
16
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Tests\Api\Providers\Decorators\PluralDecorator; |
|
17
|
|
|
use SlayerBirden\DFCodeGeneration\Generator\Tests\Api\ReflectionEntitySpecProvider; |
|
18
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
19
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
|
20
|
|
|
|
|
21
|
|
|
final class GetsTestCommand extends AbstractApiCommand |
|
22
|
|
|
{ |
|
23
|
|
|
protected function configure() |
|
24
|
|
|
{ |
|
25
|
|
|
parent::configure(); |
|
26
|
|
|
$this->setName('test:api:gets') |
|
27
|
|
|
->setDescription('Api Test for get multiple action.') |
|
28
|
|
|
->setHelp('This command creates the Codeception Api Test for Get Multiple Action for given entity.'); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* {@inheritdoc} |
|
33
|
|
|
* @param InputInterface $input |
|
34
|
|
|
* @param OutputInterface $output |
|
35
|
|
|
* @throws \Twig_Error_Loader |
|
36
|
|
|
* @throws \Twig_Error_Runtime |
|
37
|
|
|
* @throws \Twig_Error_Syntax |
|
38
|
|
|
*/ |
|
39
|
|
|
protected function execute(InputInterface $input, OutputInterface $output) |
|
40
|
|
|
{ |
|
41
|
|
|
$baseProvider = new BaseProvider($this->entityClassName); |
|
42
|
|
|
|
|
43
|
|
|
$generator = new GetsGenerator( |
|
44
|
|
|
new CachedProvider( |
|
45
|
|
|
new DecoratedProvider( |
|
46
|
|
|
$baseProvider, |
|
47
|
|
|
new EntityDataDecorator( |
|
48
|
|
|
$this->entityClassName, |
|
49
|
|
|
new ReflectionEntitySpecProvider($this->entityClassName) |
|
50
|
|
|
), |
|
51
|
|
|
new PluralDecorator( |
|
52
|
|
|
$this->entityClassName, |
|
53
|
|
|
new ReflectionEntitySpecProvider($this->entityClassName) |
|
54
|
|
|
), |
|
55
|
|
|
new EntityIdDecorator($this->entityClassName), |
|
56
|
|
|
new RelationsProviderDecorator($this->entityClassName), |
|
57
|
|
|
new OwnerDecorator($this->entityClassName), |
|
58
|
|
|
new EntityNamePluralDecorator() |
|
59
|
|
|
) |
|
60
|
|
|
) |
|
61
|
|
|
); |
|
62
|
|
|
$this->writer->write($generator->generate(), $generator->getFileName()); |
|
|
|
|
|
|
63
|
|
|
|
|
64
|
|
|
parent::execute($input, $output); |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
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.