Passed
Pull Request — master (#81)
by
unknown
04:38 queued 01:05
created

CamelCaseNameGeneratorSpec::it_is_initializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace spec\Gesdinet\JWTRefreshTokenBundle\NameGenerator;
4
5
use Gesdinet\JWTRefreshTokenBundle\NameGenerator\CamelCaseNameGenerator;
6
use PhpSpec\ObjectBehavior;
7
8
/**
9
 * Spec for Gesdinet\JWTRefreshTokenBundle\NameGenerator\CamelCaseNameGenerator.
10
 *
11
 * @covers \Gesdinet\JWTRefreshTokenBundle\NameGenerator\CamelCaseNameGenerator
12
 */
13 View Code Duplication
class CamelCaseNameGeneratorSpec extends ObjectBehavior
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
    //------------------------------------------------------------------------------------------------------------------
16
    // Spec: Class / interfaces
17
    //------------------------------------------------------------------------------------------------------------------
18
19
    public function it_is_initializable()
20
    {
21
        $this->shouldHaveType('Gesdinet\JWTRefreshTokenBundle\NameGenerator\CamelCaseNameGenerator');
22
    }
23
24
    public function it_implements_name_generator_interface()
25
    {
26
        $this->shouldImplement('Gesdinet\JWTRefreshTokenBundle\NameGenerator\NameGeneratorInterface');
27
    }
28
29
    public function it_should_return_underscored_values_from_snake_case()
30
    {
31
        /* @var CamelCaseNameGenerator|CamelCaseNameGeneratorSpec $this */
32
33
        // Method under test
34
        $this->generateName('refresh_token')
35
             ->shouldReturn('refreshToken');
36
    }
37
38
    public function it_should_return_underscored_values_from_camel_case()
39
    {
40
        /* @var CamelCaseNameGenerator|CamelCaseNameGeneratorSpec $this */
41
42
        // Method under test
43
        $this->generateName('refreshToken')
44
             ->shouldReturn('refreshToken');
45
    }
46
}
47