it_should_get_tenant_aware_prefixes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 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
15
namespace spec\SWP\Bundle\MultiTenancyBundle\Doctrine\PHPCR;
16
17
use PhpSpec\ObjectBehavior;
18
use SWP\Component\MultiTenancy\PathBuilder\TenantAwarePathBuilderInterface;
19
20
class PrefixCandidatesSpec extends ObjectBehavior
21
{
22
    public function let()
23
    {
24
        $this->beConstructedWith([]);
25
    }
26
27
    public function it_is_initializable()
28
    {
29
        $this->shouldHaveType('Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\PrefixCandidates');
30
    }
31
32
    public function it_should_get_tenant_aware_prefixes(TenantAwarePathBuilderInterface $pathBuilder)
33
    {
34
        $pathsNames = ['routes', 'custom'];
35
        $this->setRoutePathsNames($pathsNames);
36
        $pathBuilder->build($pathsNames)->willReturn(['/swp/default/routes', '/swp/default/custom']);
37
        $this->setPathBuilder($pathBuilder);
38
        $this->getPrefixes()->shouldReturn(['/swp/default/routes', '/swp/default/custom']);
39
    }
40
}
41