PromisorInterfaceTestCase::testClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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