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

CommandLineTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testAsString() 0 3 1
A testCreate() 0 4 1
A testCreateWithInvalidArgument() 0 4 1
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