文件名称:PHP测试框架Codeception.zip
文件大小:412KB
文件格式:ZIP
更新时间:2022-08-08 01:52:13
开源项目
Codeception 是一个全堆栈的 PHP 测试框架。 Inspired by BDD, it provides an original way for writing acceptance, functional, and unit tests. It's easy to write, easy to understand, and easy to run in a browser or its emulator. 测试示例: <?php class UserControllerCest { public $class = 'UserController'; public function createAction(CodeGuy $I) { $I->haveFakeClass($userController = Stub::make('UserController')); $I->executeTestedMethodOn($userController, array('username' => 'MilesDavis', 'email' => 'miles@davis.com')) ->seeResultEquals(true) ->seeMethodInvoked($userController, 'renderHtml') ->seeInDabatase('users', array('username' => 'MilesDavis')); } } ?> 标签:Codeception