IS NOT MAINTAINED ANYMORE, use PHPT tests instead
What is this?
CleverStyle Tester is simple tool to test your PHP applications, (*1)
At first it was small script for testing of CleverStyle CMS, but I found it can be helpful for others helpful,
and decided to maintain it as separate autonomous package. Hope, you'll like it), (*2)
Author – Nazar Mokrynskyi nazar@mokrynskyi.com, (*3)
Copyright (c) 2013, Nazar Mokrynskyi, (*4)
Features
- Testing of PHP applications through browser
- Testing of PHP applications through terminal
- Interactive displaying of testing progress
Requirements:
- Unix-like operating system
- PHP 5.4+
How to install?
Composer
Simply add dependency on nazar-pc/cstester to your project's composer.json:, (*5)
{
"require": {
"nazar-pc/cstester": "*"
}
}
Git
Run git clone https://github.com/nazar-pc/CSTester.git inside project directory., (*6)
Manual
Download zip/tarball from GitHub repository and extract to project directory (actually, only src/nazarpc/CSTester.php file is needed,
so, you can extract only this one file (for CLI mode, for HTML copy includes directory)., (*7)
How to use?
Put into root directory of the project test.php with such content (assumed composer is used, otherwise include src/nazarpc/CSTester.php file in any possible way):, (*8)
<?php
/**
* Include CSTester class
*/
require __DIR__.'/vendor/autoload.php';
use nazarpc\CSTester;
/**
* Create class instance and run testing
*/
(new CSTester(__DIR__.'/tests'))->run();
tests directory should contain tests of the project., (*9)
Open http://website/test.php through browser, or run php test.php from terminal., (*10)
Full example of usage in example directory, it is really very simple., (*11)
Travis CI
Sample of .travis.yml for Travic CI:, (*12)
language: php
php:
- 5.5
- 5.4
script: php test.php
Contributing
Feel free to report issues and send pull requests, all this is highly appreciated., (*13)