<?php
/**
 * PhalApi_Admin\Api\Task_Test
 *
 * 针对 ./src/admin/Api/Task.php Admin\Api\Task 类的PHPUnit单元测试
 *
 * @author: dogstar 20200113
 */

namespace tests\Admin\Api;
use Admin\Api\Task;
use PhalApi\Helper\TestRunner;

class PhpUnderControl_AdminApiTask_Test extends \PHPUnit\Framework\TestCase
{
    public $adminApiTask;

    protected function setUp()
    {
        parent::setUp();

        $this->adminApiTask = new \Admin\Api\Task();
    }

    protected function tearDown()
    {
        // 输出本次单元测试所执行的SQL语句
        // var_dump(\PhalApi\DI()->tracer->getSqls());

        // 输出本次单元测试所涉及的追踪埋点
        // var_dump(\PhalApi\DI()->tracer->getStack());
    }

    /**
     * @group testAddTaskConfig
     */ 
    public function testAddTaskConfig()
    {

        $url = "s=Admin.Task.AddTaskConfig&title=test&task_service=App.Site.Index";

        $rs = TestRunner::go($url);

        $this->assertTrue(is_int($rs['id']));

        $this->assertGreaterThanOrEqual(0, $rs['id']);

    }


}
