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
|
2 |
|
protected function configure() |
24
|
|
|
{ |
25
|
2 |
|
parent::configure(); |
26
|
2 |
|
$this->setName('test:api:gets') |
27
|
2 |
|
->setDescription('Api Test for get multiple action.') |
28
|
2 |
|
->setHelp('This command creates the Codeception Api Test for Get Multiple Action for given entity.'); |
29
|
2 |
|
} |
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
|
2 |
|
protected function execute(InputInterface $input, OutputInterface $output) |
40
|
|
|
{ |
41
|
2 |
|
$baseProvider = new BaseProvider($this->entityClassName); |
42
|
|
|
|
43
|
2 |
|
$generator = new GetsGenerator( |
44
|
2 |
|
new CachedProvider( |
45
|
2 |
|
new DecoratedProvider( |
46
|
2 |
|
$baseProvider, |
47
|
2 |
|
new EntityDataDecorator( |
48
|
2 |
|
$this->entityClassName, |
49
|
2 |
|
new ReflectionEntitySpecProvider($this->entityClassName) |
50
|
|
|
), |
51
|
2 |
|
new PluralDecorator( |
52
|
2 |
|
$this->entityClassName, |
53
|
2 |
|
new ReflectionEntitySpecProvider($this->entityClassName) |
54
|
|
|
), |
55
|
2 |
|
new RelationsProviderDecorator($this->entityClassName), |
56
|
2 |
|
new OwnerDecorator($this->entityClassName), |
57
|
2 |
|
new EntityNamePluralDecorator() |
58
|
|
|
) |
59
|
|
|
) |
60
|
|
|
); |
61
|
2 |
|
$this->writer->write($generator->generate(), $generator->getFileName()); |
|
|
|
|
62
|
|
|
|
63
|
2 |
|
parent::execute($input, $output); |
64
|
2 |
|
} |
65
|
|
|
} |
66
|
|
|
|
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.