Completed
Push — master ( 0375a2...821836 )
by Ivannis Suárez
02:49
created

SpecificationTestCase::testClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of the Cubiche package.
4
 *
5
 * Copyright (c) Cubiche
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Cubiche\Core\Specification\Tests\Units;
11
12
use Cubiche\Core\Specification\Specification;
13
14
/**
15
 * Specification Test Case class.
16
 *
17
 * @author Ivannis Suárez Jerez <[email protected]>
18
 * @author Karel Osorio Ramírez <[email protected]>
19
 */
20
abstract class SpecificationTestCase extends SpecificationInterfaceTestCase
21
{
22
    /**
23
     * Test class.
24
     */
25
    public function testClass()
26
    {
27
        $this
28
            ->testedClass
29
                ->isSubClassOf(Specification::class)
30
        ;
31
    }
32
33
    /**
34
     * Test __call.
35
     */
36
    public function testMagicCall()
37
    {
38
        parent::testMagicCall();
39
40
        $this
41
            ->given($specificationMock = $this->newDefaultMockTestedInstance())
42
            ->given($specification = $this->newRandomSpecification())
43
            ->exception(function () use ($specificationMock, $specification) {
44
                $specificationMock->foo($specification);
45
            })
46
                ->isInstanceOf(\BadMethodCallException::class)
47
            ;
48
    }
49
}
50