Completed
Pull Request — master (#1)
by Rafał
10:37
created

it_should_test_configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
3
/**
4
 * This file is part of the Superdesk Web Publisher MultiTenancy Bundle.
5
 *
6
 * Copyright 2015 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 2015 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 CmfCandidatesConfiguratorSpec extends ObjectBehavior
20
{
21
    private $prefixes;
22
23
    public function let(TenantAwarePathBuilderInterface $pathBuilder)
24
    {
25
        $this->prefixes = ['routes', 'routes2'];
26
        $this->beConstructedWith($pathBuilder, $this->prefixes);
27
    }
28
29
    public function it_is_initializable()
30
    {
31
        $this->shouldHaveType('SWP\MultiTenancyBundle\Doctrine\PHPCR\CmfCandidatesConfigurator');
32
    }
33
34
    public function it_should_test_configure($candidates, $pathBuilder)
35
    {
36
        $pathBuilder->build($this->prefixes)->willReturn(['/swp/default/routes', '/swp/default/routes2']);
37
38
        $candidates->beADoubleOf('Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\PrefixCandidates');
39
        $candidates->setPrefixes(['/swp/default/routes', '/swp/default/routes2'])->shouldBeCalled();
40
41
        $this->configure($candidates)->shouldReturn(null);
42
    }
43
}
44