AnnotationServiceTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testServiceController() 0 4 1
A testIsolationOfControllerModifiers() 0 6 1
A testFastRegister() 0 6 1
1
<?php
2
/**
3
 * This file is part of the silex-annotation-provider package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 *
7
 * @license       MIT License
8
 * @copyright (c) 2018, Dana Desrosiers <[email protected]>
9
 */
10
11
namespace DDesrosiers\Test\SilexAnnotations;
12
13
class AnnotationServiceTest extends AnnotationTestBase
14
{
15
    public function testServiceController()
16
    {
17
        $this->assertEndPointStatus(self::GET_METHOD, '/test/test1', self::STATUS_OK);
18
    }
19
20
    public function testIsolationOfControllerModifiers()
21
    {
22
        $this->assertEndPointStatus(self::GET_METHOD, '/test/before', self::STATUS_ERROR);
23
        $this->setup();
24
        $this->assertEndPointStatus(self::GET_METHOD, '/test/test1', self::STATUS_OK);
25
    }
26
27
    public function testFastRegister()
28
    {
29
        $this->assertEndPointStatus(self::GET_METHOD, '/two/test', self::STATUS_OK);
30
        // there are 35 routes, but only 2 are registered (the ones with prefix '/' and '/two')
31
        $this->assertEquals(2, count($this->app['routes']->all()));
32
    }
33
}
34
35
class NotCache
36
{
37
38
}