Download the PHP package aaronhipple/sampler without Composer
On this page you can find all versions of the php package aaronhipple/sampler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download aaronhipple/sampler
More information about aaronhipple/sampler
Files in aaronhipple/sampler
Download aaronhipple/sampler
More information about aaronhipple/sampler
Files in aaronhipple/sampler
Vendor aaronhipple
Package sampler
Short Description Test inline code samples from your docblocks using PHPUnit
License MIT
Package sampler
Short Description Test inline code samples from your docblocks using PHPUnit
License MIT
Please rate this library. Is it a good library?
Informations about the package sampler
sampler
Test inline code samples from your docblocks using PHPUnit!
caveats
- This is not particularly mature. Issues and pull requests welcome.
- The extracted sample code is
eval
'd for testing, with all those security implications. As always, be mindful only to run trusted code in sensitive environments. - Right now it only works on classes, class methods, and functions. It does no magic to expose private or protected methods, so normal rules apply.
usage
First, install sampler
as a dependency.
Then, in your PHPUnit suite, implement a case extending AbstractSampleTestCase
.
Finally, write some samples! You can use our @sample
annotation...
...or good ol' inline markdown.
- use PHPUnit\Framework\Assert;
- Assert::assertEquals(
- 'Hello, Aaron!',
- say_hello('Aaron')
- );
- use PHPUnit\Framework\Assert;
- Assert::assertEquals(
- 'Hello, Frank!',
- say_hello('Frank')
- );
Run your test suite as usual, with phpunit
.
contributing
- Pull requests are welcome.
- More tests please.
- PSR-2 is good. Use
phpcbf
.
All versions of sampler with dependencies
PHP Build Version
Package Version
Requires
phpunit/phpunit Version
>=5.0
phpdocumentor/reflection-docblock Version ^3.0
nikic/php-parser Version ^3.0
erusev/parsedown Version ^1.6
phpdocumentor/reflection-docblock Version ^3.0
nikic/php-parser Version ^3.0
erusev/parsedown Version ^1.6
The package aaronhipple/sampler contains the following files
Loading the files please wait ....