Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dan-da/tester-php
A simple one-file php test harness.
https://github.com/dan-da/tester-php
php php-testing phptest test-automation test-harness testing
Last synced: 8 days ago
JSON representation
A simple one-file php test harness.
- Host: GitHub
- URL: https://github.com/dan-da/tester-php
- Owner: dan-da
- License: gpl-3.0
- Created: 2017-09-06T10:59:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-13T22:39:15.000Z (over 5 years ago)
- Last Synced: 2024-12-22T07:18:39.713Z (about 1 month ago)
- Topics: php, php-testing, phptest, test-automation, test-harness, testing
- Language: PHP
- Size: 22.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tester-php
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.# Let's see an example test.
The test is in file eq.test.php.
```
test1();
}protected function test1() {
$this->eq( 1, "1.00", 'one' );
$this->eq( 2, "2.00", 'two' );
}}
```## And now let's execute it.
```
$ ../tester.php
Running tests in eq...
[pass] 1 == 1.00 | one
[pass] 2 == 2.00 | two2 tests passed.
0 tests failed.
```# Usage
```
tester.php [testfilename]
By default, all files matching *.test.php in current directory will be run.
```# Installation and Running.
## Library install
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.
## Standalone install
```
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
```### Run tests.
```
$ cd tests
$ ../tester.php
```# Todos
* add more example test cases
* add proper help/usage.