TextUtilsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConvertToPascalCase() 0 8 1
A testConvertToCamelCase() 0 8 1
1
<?php declare( strict_types=1 );
2
3
namespace Coco\SourceWatcher\Tests\Utils;
4
5
use Coco\SourceWatcher\Utils\TextUtils;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * Class TextUtilsTest
10
 *
11
 * @package Coco\SourceWatcher\Tests\Utils
12
 */
13
class TextUtilsTest extends TestCase
14
{
15
    public function testConvertToCamelCase () : void
16
    {
17
        $textUtils = new TextUtils();
18
19
        $given = "this_is_a_text";
20
        $expected = "thisIsAText";
21
22
        $this->assertEquals( $expected, $textUtils->textToCamelCase( $given ) );
23
    }
24
25
    public function testConvertToPascalCase () : void
26
    {
27
        $textUtils = new TextUtils();
28
29
        $given = "this_is_a_text";
30
        $expected = "ThisIsAText";
31
32
        $this->assertEquals( $expected, $textUtils->textToPascalCase( $given ) );
33
    }
34
}
35