详解Yaf框架PHPUnit集成测试要领
本文先容了详解Yaf框架PHPUnit集成测试要领,分享给各人,详细如下: 测试目次 phpunit.xml bootstrap.php 测试框架进口文件 TestCase.php 测试文件基本类 getApplication(); parent::setUp(); }public function testAppPath() public function testApp() public function testApplication() public function getApplication() public function setApplication() TokenServiceTest.php service类例子 public function testCreateToken() { $token = self::$tokenService->createToken('22'); $this->assertInternalType('array',$token); $this->assertInternalType('string',$token['token']); } } BaseControllerTest.php controller类例子 getDispatcher()->returnResponse(true)->dispatch($request);
$contents = $response->getBody();
$data = json_decode($contents,true);
$this->assertInternalType('array',$data);
}
}
以上就是本文的所有内容,但愿对各人的进修有所辅佐,也但愿各人多多支持编程之家。 (编辑:湖南网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |