Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/callumacrae/phpcheck
A testing library for PHP loosely based on Haskell's QuickCheck library.
https://github.com/callumacrae/phpcheck
Last synced: 2 months ago
JSON representation
A testing library for PHP loosely based on Haskell's QuickCheck library.
- Host: GitHub
- URL: https://github.com/callumacrae/phpcheck
- Owner: callumacrae
- Created: 2012-07-01T11:13:29.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-07-03T21:40:50.000Z (over 12 years ago)
- Last Synced: 2024-10-10T00:10:51.323Z (3 months ago)
- Language: PHP
- Size: 184 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHPCheck
PHPCheck is a testing library for PHP loosely based on Haskell's QuickCheck.
## Installation
There are two ways of getting PHPCheck into your project. The first is to require it as you would any other PHP library:
```php
claim` method to make "claims". It accepts the following arguments:```php
$phpcheck->claim( string $testName , function $predicate [ , array $specifiers ] )
````$testName` is the name of the test (obviously).
`$predicate` is a function which returns true if the test passes. Anything else is a fail.
`$specifiers` is an optional array of specifiers to be passed to the predicate function. They are usually like this:
```php
group('Numbers');$tests->claim('Less than', function ($a, $b) {
return ($a < $b);
}, array(
PHPCheck::Number(0, 10),
PHPCheck::Number(10, 20);
));$tests->check();
```## License
![Creative Commons License](http://i.creativecommons.org/l/by-sa/3.0/88x31.png)
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-sa/3.0/).