<?php

class ExecutorTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var \MeadSteve\Console\Executor
     */
    protected $testedExecutor;

    protected function setUp()
    {
        $this->testedExecutor = new MeadSteve\Console\Executor();
    }

    function testExecute_ThrowsExceptionOnInvalidCommand()
    {
        $this->setExpectedException(
            'MeadSteve\Console\Exceptions\ExecutionError',
            "git: 'foobar' is not a git command. See 'git --help'."
        );
        $this->testedExecutor->execute("git foobar");
    }

    function testExecute_ReturnsArrayOnValidCommand()
    {
        $output = $this->testedExecutor->execute("git status");
        $this->assertInternalType('array', $output);
    }
}
 
<?php

class ExecutorTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var \MeadSteve\Console\Executor
     */
    protected $testedExecutor;

    protected function setUp()
    {
        $this->testedExecutor = new MeadSteve\Console\Executor();
    }

    function testExecute_ThrowsExceptionOnInvalidCommand()
    {
        $this->setExpectedException(
            'MeadSteve\Console\Exceptions\ExecutionError',
            "git: 'foobar' is not a git command. See 'git --help'."
        );
        $this->testedExecutor->execute("git foobar");
    }

    function testExecute_ThrowsCommandNotFoundErrorWhenNotFond()
    {
        $this->setExpectedException(
            'MeadSteve\Console\Exceptions\CommandNotFoundError'
        );
        $this->testedExecutor->execute("gitDSFGscvb foobar");
    }

    function testExecute_ReturnsArrayOnValidCommand()
    {
        $output = $this->testedExecutor->execute("git status");
        $this->assertInternalType('array', $output);
    }
}
 
Add test for CommandNotFoundError exception being thrown by Executor.
Add test for CommandNotFoundError exception being thrown by Executor.
