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

PromisorInterfaceTestCase::testPromise()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
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
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