Completed
Pull Request — master (#6)
by Chuck
02:02
created

CompositeSpecificationTest::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright 2010-2015 Mike van Riel<[email protected]>
9
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
10
 * @link      http://phpdoc.org
11
 */
12
13
namespace Flyfinder\Specification;
14
15
use PHPUnit\Framework\TestCase;
16
use Mockery as m;
17
18
/**
19
 * Test case for CompositeSpecification
20
 * @coversDefaultClass Flyfinder\Specification\CompositeSpecification
21
 */
22
class CompositeSpecificationTest extends TestCase
23
{
24
    /** @var HasExtension */
25
    private $hasExtension;
26
27
    /** @var m::MockObject|CompositeSpecification */
28
    private $fixture;
29
30
    /**
31
     * Initializes the fixture for this test.
32
     */
33
    public function setUp()
34
    {
35
        $this->hasExtension = m::mock('Flyfinder\Specification\HasExtension');
36
        $this->fixture = $this->getMockForAbstractClass('Flyfinder\Specification\CompositeSpecification');
37
    }
38
39
    public function tearDown()
40
    {
41
        m::close();
42
    }
43
44
    /**
45
     * @covers ::andSpecification
46
     * @uses Flyfinder\Specification\AndSpecification
47
     */
48
    public function testAndSpecification()
49
    {
50
        $this->assertInstanceOf(
51
            'Flyfinder\Specification\AndSpecification',
52
            $this->fixture->andSpecification($this->hasExtension)
53
        );
54
    }
55
56
    /**
57
     * @covers ::orSpecification
58
     * @uses Flyfinder\Specification\OrSpecification
59
     */
60
    public function testOrSpecification()
61
    {
62
        $this->assertInstanceOf(
63
            'Flyfinder\Specification\OrSpecification',
64
            $this->fixture->orSpecification($this->hasExtension)
65
        );
66
    }
67
68
    /**
69
     * @covers ::notSpecification
70
     * @uses Flyfinder\Specification\NotSpecification
71
     */
72
    public function testNotSpecification()
73
    {
74
        $this->assertInstanceOf(
75
            'Flyfinder\Specification\NotSpecification',
76
            $this->fixture->notSpecification()
77
        );
78
    }
79
}
80