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

MultispacedParserTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 34
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A getMapFromSampleLine() 0 7 1
A getMapFromEmptyLine() 0 4 1
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