Failed Conditions
Push — master ( 01d6ae...9ca6d9 )
by Philippe
534:14 queued 469:10
created

CommandLineTest::testCreateWithInvalidArgument()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpSpellcheck\Tests\Utils;
6
7
use PhpSpellcheck\Exception\InvalidArgumentException;
8
use PhpSpellcheck\Utils\CommandLine;
9
use PHPUnit\Framework\TestCase;
10
11
class CommandLineTest extends TestCase
12
{
13
14
    public function testCreate()
15
    {
16
        $this->assertInstanceOf(CommandLine::class, new CommandLine('ls'));
17
        $this->assertInstanceOf(CommandLine::class, new CommandLine(['ls']));
18
    }
19
20
    public function testCreateWithInvalidArgument()
21
    {
22
        $this->expectException(InvalidArgumentException::class);
23
        new CommandLine(4);
24
    }
25
26
    public function testAsString()
27
    {
28
        $this->assertSame("'ls' '-lsa'", (new CommandLine(['ls', '-lsa']))->asString());
29
    }
30
}
31