Completed
Push — master ( 794f3d...1e9726 )
by diego
07:00
created

CountCommandTest::counts_lines_based_on_regex()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
namespace Diego\Grepper\Tests\Command;
3
4
use Diego\Grepper\Command\CountCommand;
5
6
/**
7
 * Class CountCommandTest
8
 */
9
class CountCommandTest extends BaseCommandTestCase
10
{
11
    /**
12
     * @test
13
     */
14
    public function is_instantiable()
15
    {
16
        $command = new CountCommand;
17
        $this->assertTrue($command instanceof CountCommand);
18
    }
19
20
    /**
21
     * @test
22
     */
23
    public function counts_lines_based_on_regex()
24
    {
25
        $name = 'count';
26
        $tester = $this->setUpCommandTesterFor($name, CountCommand::class);
27
        $tester->execute(['command' => $name, 'input' => 'vfs://root/input.csv', 'expression' => '/^[0-9]{3}$/']);
28
29
        $this->assertRegExp('/Found 2 matches\./', $tester->getDisplay());
30
    }
31
}
32