Passed
Push — master ( 6998a3...224daf )
by Daniel
02:08
created

UnderscoreToSpaceFormatterTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 17
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
/**
4
 * This file is part of the Csv-Machine package.
5
 *
6
 * (c) Dan McAdams <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace RoadBunch\Csv\Tests\Formatter;
13
14
use PHPUnit\Framework\TestCase;
15
use RoadBunch\Csv\Formatter\UnderscoreToSpaceFormatter;
16
17
/**
18
 * Class UnderscoreToSpaceFormatterTest
19
 *
20
 * @author  Dan McAdams
21
 * @package RoadBunch\Csv\Tests\Formatters
22
 */
23
class UnderscoreToSpaceFormatterTest extends TestCase
24
{
25
    public function testCreateFormatter()
26
    {
27
        $formatter = new UnderscoreToSpaceFormatter();
28
        $this->assertNotNull($formatter);
29
    }
30
31
    public function testReplacesUnderscoresWithSpaces()
32
    {
33
        $testLowerCaseHeader = ['first___name', 'last_name', 'email address'];
34
        $testUpperCaseHeader = ['first   name', 'last name', 'email address'];
35
36
        $this->assertEquals($testUpperCaseHeader, UnderscoreToSpaceFormatter::format($testLowerCaseHeader));
37
    }
38
}
39