Passed
Push — master ( a434d7...804b16 )
by Jean Paul
01:36
created

JsonExtractorTest::testSetGetColumns()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 0
1
<?php declare( strict_types = 1 );
2
3
namespace Coco\SourceWatcher\Tests\Core\Extractors;
4
5
use Coco\SourceWatcher\Core\Extractors\JsonExtractor;
6
7
use PHPUnit\Framework\TestCase;
8
9
class JsonExtractorTest extends TestCase
10
{
11
    public function testSetterGetterAttributeInput () : void
12
    {
13
        $jsonExtractor = new JsonExtractor();
14
15
        $givenInput = "/some/file/path/file.json";
16
        $expectedInput = "/some/file/path/file.json";
17
18
        $jsonExtractor->setInput( $givenInput );
19
20
        $this->assertEquals( $expectedInput, $jsonExtractor->getInput() );
21
    }
22
23
    public function testSetGetColumns () : void
24
    {
25
        $jsonExtractor = new JsonExtractor();
26
27
        $givenColumns = array( "color" => "colors.*.color" );
28
        $expectedColumns = array( "color" => "colors.*.color" );
29
30
        $jsonExtractor->setColumns( $givenColumns );
31
32
        $this->assertEquals( $expectedColumns, $jsonExtractor->getColumns() );
33
    }
34
}
35