lxHive supports testing with PHPBench.
A phpbench.json.dist
file is setup in the project root folder of your lxHive app.
PHPBench requires PHP >= 7.1 and is therefore NOT included as a composer dependency.
You can either install PHPBench globally or fetch the Phar locally into lxHive root.
cd <lxhive-root>
curl -o phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar
curl -o phpbench.phar.pubkey https://phpbench.github.io/phpbench/phpbench.phar.pubkey
phpbench.phar and phpbench.pharpubkey are excluded via .gitignore.
php phpbench.phar run <options>
You may create your custom configuration file (phpbench.json
) in the root folder. This file is excluded via .gitignore
namespace | folder | notes |
---|---|---|
\Bench |
benchmarks/* |
- Benchmark Classes have to have the
*Bench
suffix, i.e.BootstrapBench
- Benchmark methods have to have the
bench*
prefix, i.e.benchFactory()
Benchmark files are included in .gitignore
(except the example), thus you can freely create your own tests.
See documentation: http://phpbench.readthedocs.io/en/latest/writing-benchmarks.html