This commit is contained in:
2022-03-21 11:16:38 +08:00
commit e89e807c64
1040 changed files with 284164 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<?php
namespace App;
use App\Api\Site;
use PhalApi\Helper\TestRunner;
/**
* PhpUnderControl_ApiSite_Test
*
* 针对 App\Api\Site 类的PHPUnit单元测试
*
* @author: dogstar 20170703
*/
class PhpUnderControl_ApiSite_Test extends \PHPUnit_Framework_TestCase
{
public $site;
protected function setUp()
{
parent::setUp();
$this->site = new Site();
}
protected function tearDown()
{
}
/**
* @group testGetRules
*/
public function testGetRules()
{
$rs = $this->site->getRules();
$this->assertNotEmpty($rs);
}
public function testIndex()
{
$this->assertTrue(true);
return;
//Step 1. 构建请求URL
$url = 'service=App.Site.Index&username=dogstar';
//Step 2. 执行请求
$rs = TestRunner::go($url);
//Step 3. 验证
$this->assertNotEmpty($rs);
$this->assertArrayHasKey('title', $rs);
}
}