Completed
Pull Request — master (#18)
by Chad
01:19
created

MultispacedParserTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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