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

SpecificationTestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 2
cbo 2
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testClass() 0 7 1
A testMagicCall() 0 13 1
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