Completed
Pull Request — master (#1)
by Rafał
04:59
created

PrefixCandidatesSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 4 1
A it_should_get_tenant_aware_prefixes() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of the Superdesk Web Publisher MultiTenancy Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.u. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú.
12
 * @license http://www.superdesk.org/license
13
 */
14
namespace spec\SWP\MultiTenancyBundle\Doctrine\PHPCR;
15
16
use PhpSpec\ObjectBehavior;
17
use SWP\Component\MultiTenancy\PathBuilder\TenantAwarePathBuilderInterface;
18
19
class PrefixCandidatesSpec extends ObjectBehavior
20
{
21
    public function let()
22
    {
23
        $this->beConstructedWith([]);
24
    }
25
26
    public function it_is_initializable()
27
    {
28
        $this->shouldHaveType('Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\PrefixCandidates');
29
    }
30
31
    public function it_should_get_tenant_aware_prefixes(TenantAwarePathBuilderInterface $pathBuilder)
32
    {
33
        $pathsNames = ['routes', 'custom'];
34
        $this->setRoutePathsNames($pathsNames);
35
        $pathBuilder->build($pathsNames)->willReturn(['/swp/default/routes', '/swp/default/custom']);
36
        $this->setPathBuilder($pathBuilder);
37
        $this->getPrefixes()->shouldReturn(['/swp/default/routes', '/swp/default/custom']);
38
    }
39
}
40