uwdoem/test-suite
Composer 安装命令:
composer require uwdoem/test-suite
包简介
README 文档
README
TestSuite
PHPUnit web test case class for UWDOEM projects using the Athens web framework.
Use
This library is published on packagist. To install using Composer, add the "uwdoem/test-suite": "0.*" line to your "require-dev" dependencies:
{
"require-dev": {
...
"uwdoem/test-suite": "0.*",
...
}
}
Example
Below is an example test file which makes use of the WebTestCase class:
<?php
use UWDOEM\TestSuite\WebTestCase;
class WebTest extends WebTestCase
{
/**
* Initialize the browser window
*
* @return void
*/
protected function setUp()
{
$this->setBrowser('firefox');
$this->setBrowserUrl('http://localhost:8001/');
}
/**
* A test class using WebTestCase shall be able to visit a page and retrieve
* the title.
*
* @return void
*/
public function testTitle()
{
$this->url('/form.php');
$this->assertEquals('Form', $this->title());
}
/**
* A test class using WebTestCase shall be able to fill a form with random
* data, and submit.
*
* @return void
*/
public function testFormFill()
{
$this->url('/form.php');
$this->assertEquals('Form', $this->title());
$values = $this->fillForm();
$this->element($this->using('css selector')->value('input[type=submit]'))->click();
$body = $this->element($this->using('css selector')->value('body'))->attribute('innerHTML');
foreach ($values as $value) {
$this->assertContains($value, $body);
}
}
}
统计信息
- 总下载量: 106
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-22