ScriptHandlerTest::testRunCommandOnlyInDevMode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SumoCoders\FrameworkCoreBundle\Tests\Composer;
4
5
use Composer\IO\ConsoleIO;
6
use SumoCoders\FrameworkCoreBundle\Composer\ScriptHandler;
7
8
class ScriptHandlerTest extends \PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * Test ScriptHandler->runCommandOnlyInDevMode()
12
     */
13
    public function testRunCommandOnlyInDevMode()
14
    {
15
        $io = $this->getMockBuilder(ConsoleIO::class)
16
            ->disableOriginalConstructor()
17
            ->getMock();
18
        $io->method('isDecorated')
19
            ->willReturn(true);
20
21
        $this->expectOutputString('foo' . "\n");
22
        ScriptHandler::runCommandOnlyInDevMode('echo "foo"', $io, true);
23
    }
24
}
25