Completed
Push — master ( a20e35...2a3e96 )
by Greg
03:21
created

tests/unit/Task/BehatTest.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
use AspectMock\Test as test;
3
4
class BehatTest extends \Codeception\TestCase\Test
5
{
6
    /**
7
     * @var \AspectMock\Proxy\ClassProxy
8
     */
9
    protected $behat;
10
11
    protected function _before()
12
    {
13
        $this->behat = test::double('Robo\Task\Testing\Behat', [
14
            'executeCommand' => null,
15
            'output' => new \Symfony\Component\Console\Output\NullOutput(),
16
            'logger' => new \Psr\Log\NullLogger(),
17
        ]);
18
    }
19
20
    // tests
21 View Code Duplication
    public function testBehatRun()
22
    {
23
        $behat = test::double('Robo\Task\Testing\Behat', ['executeCommand' => null, 'getConfig' => new \Robo\Config(), 'logger' => new \Psr\Log\NullLogger()]);
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
24
25
        (new \Robo\Task\Testing\Behat('behat'))->run();
26
        $behat->verifyInvoked('executeCommand');
27
    }
28
29 View Code Duplication
    public function testBehatCommand()
30
    {
31
        $behat = test::double('Robo\Task\Testing\Behat', ['executeCommand' => null, 'getConfig' => new \Robo\Config(), 'logger' => new \Psr\Log\NullLogger()]);
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
32
33
        $task = (new \Robo\Task\Testing\Behat('behat'))
34
            ->stopOnFail()
35
            ->noInteraction()
36
            ->colors();
37
        verify($task->getCommand())->equals('behat --stop-on-failure --no-interaction --colors');
38
        $task->run();
39
        $behat->verifyInvoked('executeCommand', ['behat --stop-on-failure --no-interaction --colors']);
40
    }
41
42
}
43