Completed
Push — master ( bff253...2705ab )
by Dmitry
05:49 queued 01:23
created

ConverterTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A test() 0 16 1
1
<?php
2
3
namespace Test;
4
5
use Basis\Converter;
6
7
class ConverterTest extends TestSuite
8
{
9
    public function test()
10
    {
11
        $converter = $this->app->get(Converter::class);
12
        $this->assertSame($converter, $this->app->get(Converter::class));
13
14
        $this->assertSame('a', $converter->toCamelCase('a'));
15
        $this->assertSame('A', $converter->toCamelCase('a', true));
16
17
        $this->assertSame('personState', $converter->toCamelCase('person_state'));
18
        $this->assertSame('PersonState', $converter->toCamelCase('person_state', true));
19
20
        $this->assertSame('person_role', $converter->toUnderscore('personRole'));
21
        $this->assertSame('person_role', $converter->toUnderscore('PersonRole'));
22
23
        $this->assertSame('test', $converter->toObject(['test' => 'test'])->test);
24
    }
25
}
26