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

ConverterTest::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
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