Completed
Push — master ( ea9ffc...4b17ca )
by Daniel
19:33
created

RestControllerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 1
cbo 5
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testHandle() 0 16 1
1
<?php
2
3
namespace ApiBundle\Tests\Controller;
4
5
use ApiBundle\Controller\RestController;
6
use Symfony\Component\HttpFoundation\Response;
7
8
class RestControllerTest extends \PHPUnit_Framework_TestCase
9
{
10
    public function testHandle()
11
    {
12
        $mock = $this->getMockForAbstractClass(RestController::class);
13
        $mock->expects($this->any())
14
            ->method('handle')
15
            ->will($this->returnValue(new Response()));
16
        $param = $this->getMock('Application\Domain\ValueObjectInterface');
17
18
        /**
19
         * @var $mock \ApiBundle\Controller\RestController
20
         * @var $param \Application\Domain\ValueObjectInterface
21
         */
22
        $response = $mock->handle($param);
23
24
        $this->assertInstanceOf(Response::class, $response);
25
    }
26
}
27