Completed
Push — master ( 298e09...565401 )
by Ivannis Suárez
02:36
created

PromisorInterfaceTestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

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
namespace Cubiche\Core\Async\Tests\Units\Promise;
12
13
use Cubiche\Core\Async\Promise\PromiseInterface;
14
use Cubiche\Core\Async\Promise\PromisorInterface;
15
use Cubiche\Core\Async\Tests\Units\TestCase;
16
17
/**
18
 * Promise Interface Test Case Class.
19
 *
20
 * @author Ivannis Suárez Jerez <[email protected]>
21
 * @author Karel Osorio Ramírez <[email protected]>
22
 */
23
abstract class PromisorInterfaceTestCase extends TestCase
24
{
25
    /**
26
     * Test class.
27
     */
28
    public function testClass()
29
    {
30
        $this
31
            ->testedClass
32
                ->implements(PromisorInterface::class)
33
        ;
34
    }
35
36
    /**
37
     * Test promise.
38
     */
39
    public function testPromise()
40
    {
41
        $this
42
            /* @var \Cubiche\Core\Async\Promise\PromisorInterface $promisor */
43
            ->given($promisor = $this->newDefaultTestedInstance())
44
            ->then()
45
                ->object($promisor->promise())
46
                    ->isInstanceOf(PromiseInterface::class);
47
    }
48
}
49