https://github.com/callumacrae/phpcheck
A testing library for PHP loosely based on Haskell's QuickCheck library.
https://github.com/callumacrae/phpcheck
Last synced: about 1 month 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 (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-07-03T21:40:50.000Z (almost 13 years ago)
- Last Synced: 2025-03-14T23:46:47.232Z (about 1 month ago)
- Language: PHP
- Size: 184 KB
- Stars: 6
- Watchers: 2
- 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

This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-sa/3.0/).