Passed
Pull Request — master (#35)
by
unknown
03:37
created

TaskFinderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 48
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 3 1
A testAllAppAndPluginTasks() 0 10 1
1
<?php
2
namespace Queue\Test\TestCase\Shell;
3
4
use Cake\TestSuite\TestCase;
5
use Queue\Queue\TaskFinder;
6
7
class TaskFinderTest extends TestCase
8
{
9
10
    /**
11
     *
12
     * @var \Queue\Shell\QueueShell|\PHPUnit_Framework_MockObject_MockObject
13
     */
14
    public $QueueShell;
15
16
    /**
17
     *
18
     * @var \Queue\Queue\TaskFinder
19
     */
20
    protected $taskFinder;
21
22
    /**
23
     * Fixtures to load
24
     *
25
     * @var array
26
     */
27
    public $fixtures = [
28
        'plugin.Queue.QueuedTasks',
29
    ];
30
31
    /**
32
     * Setup Defaults
33
     *
34
     * @return void
35
     */
36
    public function setUp()
37
    {
38
        parent::setUp();
39
    }
40
41
    /**
42
     *
43
     * @return void
44
     */
45
    public function testAllAppAndPluginTasks()
46
    {
47
        $this->taskFinder = new TaskFinder();
48
49
        $result = $this->taskFinder->allAppAndPluginTasks();
50
        $this->assertCount(1, $result);
51
        $this->assertArraySubset([
52
            'Queue.QueueExample'
53
        ], $result);
54
        $this->assertTrue(!in_array('Foo.QueueFoo', $result));
55
    }
56
}
57