https://github.com/kcmerrill/phpwebunit
Love TDD? Love PHPUnit? Love SimpleTest's readable red/green bar? Me too! This is a simple wrapper utility that lets one have unit test in a web browser.
https://github.com/kcmerrill/phpwebunit
Last synced: 6 days ago
JSON representation
Love TDD? Love PHPUnit? Love SimpleTest's readable red/green bar? Me too! This is a simple wrapper utility that lets one have unit test in a web browser.
- Host: GitHub
- URL: https://github.com/kcmerrill/phpwebunit
- Owner: kcmerrill
- Created: 2013-01-07T02:04:13.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-24T22:27:03.000Z (about 12 years ago)
- Last Synced: 2025-03-29T12:51:25.793Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 227 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHPWebUnit
Love TDD? Love PHPUnit? Love the simplicity of SimpleTest?
Me too .. this is a simple wrapper utility that lets one use phpunit in a web browser, that has the same visual clues that simpletest does.A simple green bar, or a red bar(with phpunit output) showing the issue.
Here is a youtube video describing it's usage: http://www.youtube.com/watch?v=an5ZjEVTg0g
It's usage is pretty simple too, depending on autoloading, you can get it down to two lines per test.
Prefered Way:
Use an IDE that has a live preview functionality.Set your base path to say: http://test.example.com/phpwebunit/index.php/ <-- You'll need to create this.
In index.php have code that would look something like this:```
$sot = __DIR__ . '/../../' . implode('/', $test);
if(file_exists($sot)){
new \kcmerrill\tdd\phpwebunit('', array('bin'=>'/usr/local/php5/bin/phpunit'), array('SCRIPT_FILENAME'=>$sot));
}
```Another Way:
```
//This will test the current php file
require_once __FILE__. '/phpwebunit';
new kcmerrill\tdd\phpwebunit;//This will test the current php's directory
require_once __FILE__. '/phpwebunit';
new kcmerrill\tdd\phpwebunit(__DIR__);
```Here are some screenshots:
[](https://travis-ci.org/kcmerrill/phpwebunit)