Completed
Push — master ( f4448b...10e7e3 )
by Vuong
01:40
created

TaskTest::testExecute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * @link https://github.com/vuongxuongminh/yii2-async
4
 * @copyright Copyright (c) 2019 Vuong Xuong Minh
5
 * @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
6
 */
7
8
namespace vxm\test\unit\async;
9
10
use Yii;
11
12
/**
13
 * Class TaskTest
14
 *
15
 * @author Vuong Minh <[email protected]>
16
 * @since 1.0.0
17
 */
18
class TaskTest extends TestCase
19
{
20
21
    public function testExecute()
22
    {
23
        $result = false;
24
25
        Yii::$app->async->run(new TaskRunnerTest, [
26
            'success' => function ($output) use (&$result) {
27
                $result = $output;
28
            }
29
        ])->wait();
30
31
        $this->assertTrue($result);
32
    }
33
34
}
35