https://github.com/paranoiq/envtesting
Fast simple and easy to use environment testing written in PHP. Can check library, services and services response. Produce console, HTML or CSV output.
https://github.com/paranoiq/envtesting
Last synced: 3 months ago
JSON representation
Fast simple and easy to use environment testing written in PHP. Can check library, services and services response. Produce console, HTML or CSV output.
- Host: GitHub
- URL: https://github.com/paranoiq/envtesting
- Owner: paranoiq
- License: bsd-3-clause
- Created: 2012-08-13T08:11:38.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-07-20T14:06:57.000Z (over 13 years ago)
- Last Synced: 2025-08-13T21:58:25.841Z (6 months ago)
- Language: PHP
- Homepage: www.wikidi.com
- Size: 392 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.TXT
Awesome Lists containing this project
README
# envtesting
Fast simple and easy to use environment testing written in PHP. Can check library, services and services response.
Produce console, HTML or CSV output.
## How to use
Envtesting provide **multiple way** how to test something. You can test:
- using regular PHP file
- using [anonymous function](http://php.net/manual/en/functions.anonymous.php)
- using static or regular "callback"(http://php.net/manual/en/language.types.callable.php)
- using object with [__invoke function](http://www.php.net/manual/en/language.oop5.magic.php#object.invoke)
```php
addTest('APC', 'envtests/library/Apc.php', 'apc'); // by file
```
Using anonymous function:
```php
addTest('SOMETHING', function() {
if (true === false) throw new \envtesting\Error('True === false');
}, 'boolean');
```
Usin regular callback:
```php
addTest('callback', array($test, 'perform_test'), 'callback');
```
Using static callback string:
```php
addTest('callback', '\we\can\call\Something::static', 'call');
```
Test using object with __invoke:
```php
addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
```
Tests can be grouped into group:
```php
group->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
$suite->group2->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
```
You can shuffle groups of shuffle tests inside groups:
```php
group->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
$suite->group->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
$suite->group2->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
$suite->shuffle(); // mix only groups
$suite->shuffle(true); // deep shuffle mix groups and tests inside group
```
Envtesting can render CSV, HTML or text output:
```php
render('csv'); // render CSV output
$suite->render('html'); // render HTML output
```

Visit more examples in: https://github.com/wikidi/envtesting/tree/master/example
## Requirments
- PHP 5.3 +
## API docs
Don't forget update docs !!!
```bash
php ~/workspace/apigen/apigen.php --source ./envtesting --source ./envtests --destination ./doc/api --todo --title "Envtesting"
```
## Meta
Author: [wikidi.com](http://wikidi.com) & [Roman Ožana](https://github.com/OzzyCzech)
For the license terms see LICENSE.TXT files.