Passed
Push — master ( d6e98a...6cf9ac )
by Daniel
01:52
created

UpperCaseWordsFormatterTest   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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConvertsLowerCaseToUpperCase() 0 9 1
A testCreateFormatter() 0 4 1
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
15
use PHPUnit\Framework\TestCase;
16
use RoadBunch\Csv\Formatter\UpperCaseWordsFormatter;
17
18
/**
19
 * Class UpperCaseWordsFormatterTest
20
 *
21
 * @author  Dan McAdams
22
 * @package RoadBunch\Csv\Tests\Formatters
23
 */
24
class UpperCaseWordsFormatterTest extends TestCase
25
{
26
    public function testCreateFormatter()
27
    {
28
        $formatter = new UpperCaseWordsFormatter();
29
        $this->assertNotNull($formatter);
30
    }
31
32
    public function testConvertsLowerCaseToUpperCase()
33
    {
34
        $testLowerCaseHeader = ['first name', 'last_name', 'email-address', 'user.id'];
35
        $testUpperCaseHeader = ['First Name', 'Last_Name', 'Email-Address', 'User.Id'];
36
37
        $formatter   = new UpperCaseWordsFormatter();
38
        $formattedHeader = $formatter->format($testLowerCaseHeader);
39
40
        $this->assertEquals($testUpperCaseHeader, $formattedHeader);
41
    }
42
}
43