MultispacedParserTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 34
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2
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
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