PromisorInterfaceTestCase   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testClass() 0 7 1
A testPromise() 0 9 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
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 Cubiche\Core\Async\Tests\Units\Promise;
13
14
use Cubiche\Core\Async\Promise\PromiseInterface;
15
use Cubiche\Core\Async\Promise\PromisorInterface;
16
use Cubiche\Core\Async\Tests\Units\TestCase;
17
18
/**
19
 * Promise Interface Test Case Class.
20
 *
21
 * @author Ivannis Suárez Jerez <[email protected]>
22
 * @author Karel Osorio Ramírez <[email protected]>
23
 */
24
abstract class PromisorInterfaceTestCase extends TestCase
25
{
26
    /**
27
     * Test class.
28
     */
29
    public function testClass()
30
    {
31
        $this
32
            ->testedClass
33
                ->implements(PromisorInterface::class)
34
        ;
35
    }
36
37
    /**
38
     * Test promise.
39
     */
40
    public function testPromise()
41
    {
42
        $this
43
            /* @var \Cubiche\Core\Async\Promise\PromisorInterface $promisor */
44
            ->given($promisor = $this->newDefaultTestedInstance())
45
            ->then()
46
                ->object($promisor->promise())
47
                    ->isInstanceOf(PromiseInterface::class);
48
    }
49
}
50