N98\Magento\Command\Developer\Module\Dependencies\FromCommandTest::testExecute PHP Метод

testExecute() публичный Метод

public testExecute ( string $moduleName, integer $all, array $contains, array $notContains )
$moduleName string
$all integer
$contains array
$notContains array
    public function testExecute($moduleName, $all, array $contains, array $notContains)
    {
        $application = $this->getApplication();
        $application->add(new FromCommand());
        $command = $this->getApplication()->find('dev:module:dependencies:from');
        $commandTester = new CommandTester($command);
        $input = array('command' => $command->getName(), 'moduleName' => $moduleName);
        switch ($all) {
            case 2:
                $input['-a'] = true;
                break;
            case 1:
                $input['--all'] = true;
                break;
            default:
                break;
        }
        $commandTester->execute($input);
        foreach ($contains as $expectation) {
            $this->assertContains($expectation, $commandTester->getDisplay());
        }
        foreach ($notContains as $expectation) {
            $this->assertNotContains($expectation, $commandTester->getDisplay());
        }
    }