PageFieldsSpec   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 51
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_extends_fields() 0 5 1
A it_implements_fields_interface() 0 4 1
A it_should_be_components() 0 4 1
A it_should_be_add_screen_attributes() 0 4 1
A it_should_be_remove_screen_attributes() 0 4 1
A it_should_connector() 0 17 1
1
<?php
2
3
/*
4
 * This file is part of the WPFoundation library.
5
 *
6
 * Copyright (c) 2015-present LIN3S <[email protected]>
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 spec\LIN3S\WPFoundation\PostTypes\Fields;
13
14
use LIN3S\WordPressPhpSpecBridge\ObjectBehavior;
15
16
/**
17
 * Spec of page fields class.
18
 *
19
 * @author Beñat Espiña <[email protected]>
20
 */
21
class PageFieldsSpec extends ObjectBehavior
22
{
23
    function let()
24
    {
25
        $this->beAnInstanceOf('fixtures\LIN3S\WPFoundation\PageFields');
26
    }
27
28
    function it_extends_fields()
29
    {
30
        $this->shouldHaveType('LIN3S\WPFoundation\PostTypes\Fields\Templates\PageFields');
31
        $this->shouldHaveType('LIN3S\WPFoundation\PostTypes\Fields\Fields');
32
    }
33
34
    function it_implements_fields_interface()
35
    {
36
        $this->shouldHaveType('LIN3S\WPFoundation\PostTypes\Fields\FieldsInterface');
37
    }
38
39
    function it_should_be_components()
40
    {
41
        $this->components()->shouldBeArray();
42
    }
43
44
    function it_should_connector()
45
    {
46
        $this->connector()->shouldReturn([
47
            [
48
                [
49
                    'param'    => 'post_type',
50
                    'operator' => '==',
51
                    'value'    => 'page',
52
                ],
53
                [
54
                    'param'    => 'page_template',
55
                    'operator' => '==',
56
                    'value'    => 'page',
57
                ],
58
            ],
59
        ]);
60
    }
61
62
    function it_should_be_add_screen_attributes()
63
    {
64
        $this->addScreenAttributes();
65
    }
66
67
    function it_should_be_remove_screen_attributes()
68
    {
69
        $this->removeScreenAttributes();
70
    }
71
}
72