试试 Codeception:http ://codeception.com
更新:
它类似于 Capybara ,但使用 PHP DSL。使用 codeception,您可以执行以下操作:
$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');
$I->seeInDatabase('pages', array('title' => 'Hobbit'));
您可以使用 Selenium2 进行浏览,也可以使用 PHPBrowser(无头)在 js 较少的场景中获得更好的性能(PHPBrowser 不执行 javascript)