PHP测试框架,Codeception 1.1.4 发布

jopen 11年前

Codeception是一个全栈式PHP测试框架,受BDD的启发。它提供了一种原始的方式来编写验收,功能和单元测试。它易编写,易于理解,能够很容易运行在一个浏览器或它的模拟器中。

这次发布增加了测试SOAP 和 REST Web services的新模块,支持XPath定位器。

<?php  $I = new WebGuy($scenario);  $I->wantTo('create wiki page');  $I->amOnPage('/');  $I->click('Pages');  $I->click('New');  $I->see('New Page');  $I->fillField('title', 'Hobbit');  $I->fillField('body', 'By Peter Jackson');  $I->click('Save');  $I->see('page created'); // notice generated  $I->see('Hobbit','h1'); // head of page of is our title  $I->seeInCurrentUrl('pages/hobbit'); // slug is generated  $I->seeInDatabase('pages', array('title' => 'Hobbit')); // data is stored in database  ?>