MultispacedParserTest::getMapFromSampleLine()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace TraderInteractive\ColumnParser\HeaderParser;
4
5
use PHPUnit\Framework\TestCase;
6
7
/**
8
 * @coversDefaultClass \TraderInteractive\ColumnParser\HeaderParser\MultispacedParser
9
 */
10
class MultispacedParserTest extends TestCase
11
{
12
    private $parser;
13
14
    public function setUp()
15
    {
16
        $this->parser = new MultispacedParser();
17
    }
18
19
    /**
20
     * This tests the basic getMap behavior.
21
     *
22
     * @test
23
     * @covers ::getMap
24
     */
25
    public function getMapFromSampleLine()
26
    {
27
        $this->assertSame(
28
            ['Name' => 6, 'Age' => 5, 'City of Birth' => 13],
29
            $this->parser->getMap('Name  Age  City of Birth')
30
        );
31
    }
32
33
    /**
34
     * This tests the getMap behavior for an empty row.
35
     *
36
     * @test
37
     * @covers ::getMap
38
     */
39
    public function getMapFromEmptyLine()
40
    {
41
        $this->assertSame([], $this->parser->getMap(''));
42
    }
43
}
44