MissingViewHandlerSpec   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 5 1
A it_should_create_missing_view_responses() 0 17 1
1
<?php
2
3
namespace spec\Knp\RadBundle\EventListener;
4
5
use PhpSpec\ObjectBehavior;
6
use Symfony\Component\HttpKernel\HttpKernelInterface;
7
8
class MissingViewHandlerSpec extends ObjectBehavior
9
{
10
    /**
11
     * @param  Symfony\Component\HttpKernel\Event\GetResponseEvent $event
12
     * @param  Symfony\Component\HttpFoundation\Request $request
13
     * @param  Symfony\Component\HttpFoundation\Response $response
14
     * @param  Symfony\Component\HttpKernel\HttpKernel $kernel
15
     */
16
    function let($event, $request, $response, $kernel)
0 ignored issues
show
Unused Code introduced by
The parameter $response 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...
17
    {
18
        $event->getKernel()->willReturn($kernel);
19
        $event->getRequest()->willReturn($request);
20
    }
21
22
    /**
23
     * @param Symfony\Component\HttpFoundation\Request $subRequest
24
     **/
25
    function it_should_create_missing_view_responses($kernel, $event, $request, $subRequest, $response)
0 ignored issues
show
Coding Style introduced by
Method name "MissingViewHandlerSpec::it_should_create_missing_view_responses" is not in camel caps format
Loading history...
26
    {
27
        $viewName   = 'App:Cheese:missingView.html.twig';
28
        $viewParams = array('some' => 'view params');
29
30
        $request->duplicate(array(), null, array(
31
            '_controller' => 'KnpRadBundle:Assistant:missingView',
32
            'viewName'    => $viewName,
33
            'viewParams'  => $viewParams
34
        ))->willReturn($subRequest);
35
36
        $kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST)->willReturn($response);
37
38
        $event->setResponse($response)->shouldBeCalled();
39
40
        $this->handleMissingView($event, $viewName, $viewParams);
41
    }
42
}
43