Completed
Push — loose-datetime-comparison-beha... ( 53d44c )
by Kamil
55:05 queued 32:14
created

it_has_default_authorization_checker()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
nc 1
cc 1
eloc 4
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\ResourceBundle\Tests;
13
14
use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
15
use Sylius\Bundle\ResourceBundle\DependencyInjection\Configuration;
16
17
/**
18
 * @author Anna Walasek <[email protected]>
19
 * @author Kamil Kokot <[email protected]>
20
 */
21
class ConfigurationTest extends \PHPUnit_Framework_TestCase
22
{
23
    use ConfigurationTestCaseTrait;
24
25
    /**
26
     * @test
27
     */
28
    public function it_does_not_break_if_not_customized()
29
    {
30
        $this->assertConfigurationIsValid(
31
            [
32
                []
33
            ]
34
        );
35
    }
36
37
    /**
38
     * @test
39
     */
40
    public function it_has_default_authorization_checker()
41
    {
42
        $this->assertProcessedConfigurationEquals(
43
            [
44
                []
45
            ],
46
            ['authorization_checker' => 'sylius.resource_controller.authorization_checker.disabled'],
47
            'authorization_checker'
48
        );
49
    }
50
51
    /**
52
     * @test
53
     */
54
    public function its_authorization_checker_can_be_customized()
55
    {
56
        $this->assertProcessedConfigurationEquals(
57
            [
58
                ['authorization_checker' => 'custom_service']
59
            ],
60
            ['authorization_checker' => 'custom_service'],
61
            'authorization_checker'
62
        );
63
    }
64
65
    /**
66
     * @test
67
     */
68
    public function its_authorization_checker_cannot_be_empty()
69
    {
70
        $this->assertPartialConfigurationIsInvalid(
71
            [
72
                ['authorization_checker' => '']
73
            ],
74
            'authorization_checker'
75
        );
76
    }
77
78
    /**
79
     * {@inheritdoc}
80
     */
81
    protected function getConfiguration()
82
    {
83
        return new Configuration();
84
    }
85
}
86