PostTypeSpec::let()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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;
13
14
use LIN3S\WordPressPhpSpecBridge\ObjectBehavior;
15
use Prophecy\Argument;
16
17
/**
18
 * Spec of PostType class.
19
 *
20
 * @author Beñat Espiña <[email protected]>
21
 */
22
class PostTypeSpec extends ObjectBehavior
23
{
24
    function let()
25
    {
26
        $this->beAnInstanceOf('fixtures\LIN3S\WPFoundation\PostType');
27
    }
28
29
    function it_extends_post_type()
30
    {
31
        $this->shouldHaveType('LIN3S\WPFoundation\PostTypes\PostType');
32
    }
33
34
    function it_implements_post_type_interface()
35
    {
36
        $this->shouldHaveType('LIN3S\WPFoundation\PostTypes\PostTypeInterface');
37
    }
38
39
    function it_should_be_fields()
40
    {
41
        $this->fields();
42
    }
43
44
    function it_should_be_permalink()
45
    {
46
        $this->permalink('dummy-permalink')->shouldReturn('dummy-permalink');
47
    }
48
49
    function it_should_be_post_type()
50
    {
51
        $this->postType();
52
    }
53
54
    function it_should_be_rewrite_rules()
55
    {
56
        $this->rewriteRules();
57
    }
58
59
    function it_should_serialize()
60
    {
61
        $object = Argument::type('Object');
62
63
        $this->serialize($object)->shouldReturn($object);
64
    }
65
66
    function it_should_be_taxonomy_type()
67
    {
68
        $this->taxonomyType();
69
    }
70
71
    function it_should_be_taxonomy_permalink()
72
    {
73
        $this->taxonomyPermalink('dummy-taxonomy-permalink', Argument::any())->shouldReturn('dummy-taxonomy-permalink');
74
    }
75
}
76