CodeceptionPHP 測試框架
Codeception 是一個(gè)全堆棧的 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' => '[email protected]'))
->seeResultEquals(true)
->seeMethodInvoked($userController, 'renderHtml')
->seeInDabatase('users', array('username' => 'MilesDavis'));
}
}
?>評論
圖片
表情
