A simple one-file php test harness.
This is a very lightweight test harness that can be easily installed with composer, or you can just copy the tester.php file into your own project.
The test is in file eq.test.php.
<?php
namespace tester;
class eq extends test_base {
public function runtests() {
$this->test1();
}
protected function test1() {
$this->eq( 1, "1.00", 'one' );
$this->eq( 2, "2.00", 'two' );
}
}
$ ../tester.php
Running tests in eq...
[pass] 1 == 1.00 | one
[pass] 2 == 2.00 | two
2 tests passed.
0 tests failed.
tester.php [testfilename]
By default, all files matching *.test.php in current directory will be run.
Normally you would install tester-php into your own project using a composer require in your project's composer.json, eg:
"require": {
"dan-da/tester-php"
}
Then run composer install.
tester.php is then available at /vendor/bin/tester.php.
git clone https://github.com/dan-da/hd-wallet-derive
cd hd-wallet-derive
php -r "readfile('https://getcomposer.org/installer');" | php
php composer.phar install
$ cd tests
$ ../tester.php
- add more example test cases
- add proper help/usage.