/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage File not found: file_doesnt_exist.ext * @covers ::execute */ public function testExecute_fileNotFound() { // mock the Kernel or create one depending on your needs $application = new Console(self::$app); $application->add(new AclLoadCommand()); $command = $application->find('acl:load'); $commandTester = new CommandTester($command); $file = 'file_doesnt_exist.ext'; $commandTester->execute(array('command' => $command->getName(), 'file' => $file)); }