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

LoopAdapterTests   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A testAddTimer() 0 4 1
A testAddPeriodicTimer() 0 4 1
A testCancelTimer() 0 4 1
A testIsTimerActive() 0 4 1
A testNextTick() 0 4 1
A testFutureTick() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche/Async component.
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\Loop;
12
13
use React\EventLoop\Timer\TimerInterface;
14
15
/**
16
 * Loop Adapter Tests class.
17
 *
18
 * @author Karel Osorio Ramírez <[email protected]>
19
 */
20
class LoopAdapterTests extends LoopTests
21
{
22
    /**
23
     * Test addTimer method.
24
     */
25
    public function testAddTimer()
26
    {
27
        $this->proxyMethodTest('addTimer', array(1, $this->delegateMock()));
28
    }
29
30
    /**
31
     * Test addPeriodicTimer method.
32
     */
33
    public function testAddPeriodicTimer()
34
    {
35
        $this->proxyMethodTest('addPeriodicTimer', array(1, $this->delegateMock()));
36
    }
37
38
    /**
39
     * Test cancelTimer method.
40
     */
41
    public function testCancelTimer()
42
    {
43
        $this->proxyMethodTest('cancelTimer', array($this->newMockInstance(TimerInterface::class)));
44
    }
45
46
    /**
47
     * Test isTimerActive method.
48
     */
49
    public function testIsTimerActive()
50
    {
51
        $this->proxyMethodTest('isTimerActive', array($this->newMockInstance(TimerInterface::class)));
52
    }
53
54
    /**
55
     * Test nextTick method.
56
     */
57
    public function testNextTick()
58
    {
59
        $this->proxyMethodTest('nextTick', array($this->delegateMock()));
60
    }
61
62
    /**
63
     * Test futureTick method.
64
     */
65
    public function testFutureTick()
66
    {
67
        $this->proxyMethodTest('futureTick', array($this->delegateMock()));
68
    }
69
}
70