
Linuxeden 开源社区 --
Codeception 2.4.0 已发布,更新内容如下:
- 兼容 PHPUnit 7.x
- 不再支持 PHP 5.4 和 PHP 5.5
- 内部 API 重构:
- 内部使用的现代 PHP 类名称
- 将 PHPUnit 相关的类移到了 codeception / phpunit-wrapper 包中。
- Cest hooks 行为调整:
- 当测试失败时调用
_failed - 当测试成功时调用
_passed - 测试成功或失败均调用
_after
- 当测试失败时调用
Codeception 是一个全堆栈的 PHP 测试框架,测试示例:
<?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'));
}
}
?>
源码下载:
转自 http://ift.tt/2F3ryOn
The post Codeception 2.4.0 发布,兼容 PHPUnit 7.x appeared first on Linuxeden开源社区.
http://ift.tt/2oylJlF
没有评论:
发表评论