RequestManipulatorSpec   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 32
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_should_get_an_attribute_from_the_given_request() 0 6 1
A it_should_indicate_whether_the_given_request_has_a_specific_attribute() 0 6 1
A it_should_set_an_attribute_from_the_given_request() 0 6 1
1
<?php
2
3
namespace spec\Knp\RadBundle\HttpFoundation;
4
5
use PhpSpec\ObjectBehavior;
6
7
class RequestManipulatorSpec extends ObjectBehavior
8
{
9
    /**
10
     * @param Symfony\Component\HttpFoundation\Request $request
11
     * @param Symfony\Component\HttpFoundation\ParameterBag $attributesBag
12
     */
13
    function let($request, $attributesBag, $queryBag, $requestBag)
0 ignored issues
show
Unused Code introduced by
The parameter $queryBag is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $requestBag is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
14
    {
15
        $request->getWrappedObject()->attributes = $attributesBag->getWrappedObject();
16
    }
17
18
    function it_should_get_an_attribute_from_the_given_request($request, $attributesBag)
0 ignored issues
show
Coding Style introduced by
Method name "RequestManipulatorSpec::it_should_get_an_attribute_from_the_given_request" is not in camel caps format
Loading history...
19
    {
20
        $attributesBag->get('foo')->willReturn('The foo value');
21
22
        $this->getAttribute($request, 'foo')->shouldReturn('The foo value');
23
    }
24
25
    function it_should_indicate_whether_the_given_request_has_a_specific_attribute($request, $attributesBag)
0 ignored issues
show
Coding Style introduced by
Method name "RequestManipulatorSpec::it_should_indicate_whether_the_given_request_has_a_specific_attribute" is not in camel caps format
Loading history...
26
    {
27
        $attributesBag->has('foo')->willReturn(false);
28
29
        $this->hasAttribute($request, 'foo')->shouldReturn(false);
30
    }
31
32
    function it_should_set_an_attribute_from_the_given_request($request, $attributesBag)
0 ignored issues
show
Coding Style introduced by
Method name "RequestManipulatorSpec::it_should_set_an_attribute_from_the_given_request" is not in camel caps format
Loading history...
33
    {
34
        $attributesBag->set('foo', 'The new foo')->shouldBeCalled();
35
36
        $this->setAttribute($request, 'foo', 'The new foo');
37
    }
38
}
39