for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace uuf6429\ElderBrother\Action;
use uuf6429\ElderBrother\Config;
use Symfony\Component\Console\Input;
use Symfony\Component\Console\Output;
class ExecuteCodeTest extends \PHPUnit_Framework_TestCase
{
public function testThatExceptionIsPropagated()
$action = new ExecuteCode(
'Do something',
function ($config, $input, $output) {
$this->assertInstanceOf(Config::class, $config);
$this->assertInstanceOf(Input\InputInterface::class, $input);
$this->assertInstanceOf(Output\OutputInterface::class, $output);
throw new \RuntimeException('Testing');
}
);
$action->setConfig(
$this->getMockBuilder(Config::class)
->disableOriginalConstructor()
->getMock()
$this->setExpectedException(\RuntimeException::class, 'Testing');
$action->execute(new Input\StringInput(''), new Output\NullOutput());