Peridot is a modern testing tool for PHP 5.4+.
This Project is Starter Kit for Peridot.
- Easy installation
- Comical face reporter (No StackTrace)
- Easy Code coverage
- Simple Assert
- PHP 5.4+
- Composer
$ git clone https://github.com/ktty1220/peridot-starter-kit.git
$ cd peridot-starter-kit
$ composer install
$ vendor/bin/peridot --help
$ vendor/bin/peridot
peridot-starter-kit
├─peridot-easy ... peridot customize config libraries
├─specs ... test specs files
├─src ... source files
└─peridot.php ... peridot bootstrap script
$ vendor/bin/peridot
this test will fail
1) this will not pass!! OMG
1 failing
1) this will not pass!! OMG:
this is bad
#0 <StackTrace> ...
#1 <StackTrace> ...
#2 <StackTrace> ...
#3 <StackTrace> ...
#4 <StackTrace> ...
#5 <StackTrace> ... <= so noisy
#6 <StackTrace> ...
#7 <StackTrace> ...
#8 <StackTrace> ...
.
.
.
StackTrace suppressed.
$ vendor/bin/peridot -r face
$ vendor/bin/peridot -r face --coverage-html report
Generate coverage report into report
directory.
Composer directory(local & global) will be automatically excluded from Code coverage.
$ vendor/bin/peridot -r face --coverage-html report --coverage-blacklist peridot-easy
vendor
directory will be excluded from coverage report.
You can use
-B
option instead of--coverage-blacklist
.
This option can be used more than one times.
$ vendor/bin/peridot -r face --coverage-html report -B peridot-easy -B peridot.php -B foo -B bar.php
$ vendor/bin/peridot -r face --coverage-html report -B . --coverage-whitelist src
src
directory only will be included in coverage report.
You can use
-W
option instead of--coverage-whitelist
.
use Peridot\Leo\Interfaces\Assert;
describe('example test', function() {
it('shoud return 1', function() {
$assert = new Assert(); // <= need "new Assert()" on every test
$assert->strictEqual(hoge(), 1);
});
});
namespace Peridot\Easy\Test; // <= use Peridot\Easy\Test namespace
describe('example test', function() {
it('shoud return 1', function() {
assert()->strictEqual(hoge(), 1); // <= no need to call "new Assert()"
});
});
© 2015 ktty1220