Completed
Push — master ( 7e1af0...188799 )
by diego
02:12
created

CreateCommandTest::copies_lines_based_on_regex()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
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\CreateCommand;
5
6
/**
7
 * Class CreateCommandTest
8
 */
9
class CreateCommandTest extends BaseCommandTestCase
10
{
11
    /**
12
     * @test
13
     */
14
    public function is_instantiable()
15
    {
16
        $command = new CreateCommand;
17
        $this->assertTrue($command instanceof CreateCommand);
18
    }
19
20
    /**
21
     * @test
22
     */
23
    public function copies_lines_based_on_regex()
24
    {
25
        $name = 'create';
26
        $tester = $this->setUpCommandTesterFor($name, CreateCommand::class);
27
        $tester->execute(['command' => $name, 'input' => 'vfs://root/input.csv', 'expression' => '/^[0-9]{3}$/', 'output' => 'vfs://root/output.csv']);
28
29
        $this->assertEquals("123\n456\n", file_get_contents('vfs://root/output.csv'));
30
    }
31
}