Passed
Push — master ( b34030...56c38f )
by Sebastian
03:50
created

CmdTest::testConfigure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of CaptainHook.
4
 *
5
 * (c) Sebastian Feldmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace sebastianfeldmann\CaptainHook\Composer;
11
12
use Composer\IO\NullIO;
13
14
class CmdTest extends \PHPUnit_Framework_TestCase
15
{
16
    /**
17
     * Tests Cmd::configure
18
     */
19
    public function testConfigure()
20
    {
21
        $event = $this->getMockBuilder('\\Composer\\Script\\Event')
22
                      ->disableOriginalConstructor()
23
                      ->getMock();
24
        $event->expects($this->once())->method('getIO')->willReturn(new NullIO());
25
        $config = sys_get_temp_dir() . DIRECTORY_SEPARATOR . md5(__FILE__);
26
        Cmd::configure($event, $config);
27
28
        $this->assertTrue(file_exists($config));
29
30
        unlink($config);
31
    }
32
}
33