addDefinitions(__DIR__ . '/../test-dependencies.php'); $container = $builder->build(); $application = new Application('Command Line Tool to process Youtrack Reports', '0.1.0'); $invoiceCommand = $container->get(InvoiceCommand::class); $application->add($invoiceCommand); $reportCommand = $container->get(ReportCommand::class); $application->add($reportCommand); $command = $application->find('report'); $commandTester = new CommandTester($command); $commandTester->execute([ // pass arguments to the helper '--file' => __DIR__ . '/../data/21-03.csv', // prefix the key with two dashes when passing options, // e.g: '--some-option' => 'option_value', // use brackets for testing array value, // e.g: '--some-option' => ['option_value'], ]); $commandTester->assertCommandIsSuccessful(); // the output of the command in the console $output = $commandTester->getDisplay(); var_dump($output); $this->assertStringContainsString('21-03.csv', $output); // ... } }