Issues (108)

src/Command/TestCommand.php (12 issues)

1
<?php
2
3
/**
4
 * @copyright Bluz PHP Team
5
 * @link https://github.com/bluzphp/bluzman
6
 */
7
8
namespace Bluzman\Command;
9
10
use Codeception;
0 ignored issues
show
The type Codeception was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Exception;
12
use Symfony\Component\Console\Input\InputArgument;
0 ignored issues
show
The type Symfony\Component\Console\Input\InputArgument was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Symfony\Component\Console\Input\InputInterface;
0 ignored issues
show
The type Symfony\Component\Console\Input\InputInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Symfony\Component\Console\Input\StringInput;
0 ignored issues
show
The type Symfony\Component\Console\Input\StringInput was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use Symfony\Component\Console\Output\OutputInterface;
0 ignored issues
show
The type Symfony\Component\Console\Output\OutputInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
17
/**
18
 * Class List command
19
 *
20
 * @package Bluzman\Command
21
 *
22
 * @author   Pavel Machekhin
23
 * @created  2013-03-28 14:03
24
 */
25
class TestCommand extends AbstractCommand
26
{
27
    /**
28 15
     * Command configuration
29
     */
30
    protected function configure()
31
    {
32 15
        $this
33
            // the name of the command (the part after "bin/bluzman")
34 15
            ->setName('test')
35
            // the short description shown while running "php bin/bluzman list"
36
            ->setDescription('Run tests')
37 15
            // the full command description shown when running the command with
38
            // the "--help" option
39
            ->setHelp('Run codeception tests')
40 15
        ;
41 15
42
        $this->addModuleArgument(InputArgument::OPTIONAL);
43
    }
44
45
    /**
46
     * @param InputInterface $input
47
     * @param OutputInterface $output
48
     * @return int
49
     * @throws Exception
50
     */
51
    protected function execute(InputInterface $input, OutputInterface $output)
52
    {
53
        // call `codeception run` command programmatically
54
        $arguments = [
55
            'run',
56
            '--config ' . PATH_ROOT . DS . 'codeception.yml'
0 ignored issues
show
The constant Bluzman\Command\DS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant Bluzman\Command\PATH_ROOT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
57
        ];
58
59
        if ($group = $input->getArgument('module')) {
60
            $arguments[] = '--group ' . $group;
61
        }
62
        $codeceptionInput = new StringInput(implode(' ', $arguments));
63
        $command = $this->getCodeceptionApplication()->find('run');
64
65
        return $command->run($codeceptionInput, $output);
66
    }
67
68
    /**
69
     * Return CodeceptionApplication
70
     */
71
    protected function getCodeceptionApplication(): Codeception\Application
0 ignored issues
show
The type Codeception\Application was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
72
    {
73
        // @todo need refactoring this part - move functions to separate files
74
        require_once PATH_VENDOR . DS . 'codeception' . DS . 'codeception' . DS . 'autoload.php';
0 ignored issues
show
The constant Bluzman\Command\PATH_VENDOR was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant Bluzman\Command\DS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
75
76
        $app = new Codeception\Application('Codeception', Codeception\Codecept::VERSION);
0 ignored issues
show
The type Codeception\Codecept was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
77
        $app->add(new Codeception\Command\Run('run'));
0 ignored issues
show
The type Codeception\Command\Run was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
78
79
        $app->registerCustomCommands();
80
81
        return $app;
82
    }
83
}
84