ScriptHandlerTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRunCommandOnlyInDevMode() 0 11 1
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