MessageSpec   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 1
dl 0
loc 48
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_should_have_a_template_accessor() 0 4 1
A it_should_have_a_parameters_accessor() 0 4 1
A it_should_have_a_pluralization_accessor() 0 4 1
A it_should_use_null_as_default_pluralization() 0 6 1
A it_should_use_empty_array_as_default_parameters() 0 6 1
A it_should_have_a_string_representation_with_replaced_parameter_holders() 0 6 1
A it_should_be_serializable() 0 4 1
1
<?php
2
3
namespace spec\Knp\RadBundle\Flash;
4
5
use PhpSpec\ObjectBehavior;
6
7
class MessageSpec extends ObjectBehavior
8
{
9
    function let()
10
    {
11
        $this->beConstructedWith('Hello {{ name }}!', array('{{ name }}' => 'George'), 123);
12
    }
13
14
    function it_should_have_a_template_accessor()
0 ignored issues
show
Coding Style introduced by
Method name "MessageSpec::it_should_have_a_template_accessor" is not in camel caps format
Loading history...
15
    {
16
        $this->getTemplate()->shouldReturn('Hello {{ name }}!');
17
    }
18
19
    function it_should_have_a_parameters_accessor()
0 ignored issues
show
Coding Style introduced by
Method name "MessageSpec::it_should_have_a_parameters_accessor" is not in camel caps format
Loading history...
20
    {
21
        $this->getParameters()->shouldReturn(array('{{ name }}' => 'George'));
22
    }
23
24
    function it_should_have_a_pluralization_accessor()
0 ignored issues
show
Coding Style introduced by
Method name "MessageSpec::it_should_have_a_pluralization_accessor" is not in camel caps format
Loading history...
25
    {
26
        $this->getPluralization()->shouldReturn(123);
27
    }
28
29
    function it_should_use_null_as_default_pluralization()
0 ignored issues
show
Coding Style introduced by
Method name "MessageSpec::it_should_use_null_as_default_pluralization" is not in camel caps format
Loading history...
30
    {
31
        $this->beConstructedWith('Hello {{ name }}!', array('{{ name }}' => 'George'));
32
33
        $this->getPluralization()->shouldReturn(null);
34
    }
35
36
    function it_should_use_empty_array_as_default_parameters()
0 ignored issues
show
Coding Style introduced by
Method name "MessageSpec::it_should_use_empty_array_as_default_parameters" is not in camel caps format
Loading history...
37
    {
38
        $this->beConstructedWith('Hello {{ name }}!');
39
40
        $this->getParameters()->shouldReturn(array());
41
    }
42
43
    function it_should_have_a_string_representation_with_replaced_parameter_holders()
0 ignored issues
show
Coding Style introduced by
Method name "MessageSpec::it_should_have_a_string_representation_with_replaced_parameter_holders" is not in camel caps format
Loading history...
44
    {
45
        $this->beConstructedWith('Hello %name%!', array('%name%' => 'John'));
46
47
        $this->__toString()->shouldReturn('Hello John!');
48
    }
49
50
    function it_should_be_serializable()
0 ignored issues
show
Coding Style introduced by
Method name "MessageSpec::it_should_be_serializable" is not in camel caps format
Loading history...
51
    {
52
        $this->shouldBeAnInstanceOf('Serializable');
53
    }
54
}
55