pmvc-plugin / unit
PMVC Test Framework
Installs: 6 345
Dependents: 47
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Requires
README
A simple phpunit wrapper let it support phpunt 4.8.35, 6.5.5, 9.5.0
In another word.
You could use is cross php version 5.5 -> 8.x
function mapping table
Code example
tests/include.php example
<?php $path = __DIR__ . '/../vendor/autoload.php'; include $path; \PMVC\Load::plug( ['unit' => null], [__DIR__ . '/../../'] );
Php TestCase code example
<?php namespace PMVC\PlugIn\hell_world; use PMVC\TestCase; class HelloWorldTest extends TestCase { }
CI config example
- Simple plugin
- More php version
- Real CircleCI example
PHPUnit Tip
- Show event
phpunit --log-events-text php://stdout
- show deprecations
phpunit --display-deprecations --testdox
-
output debug info
$this->dump(/*anything*/); //fwrite(STDERR, print_r(?, true));
-
trigger PMVC dev dump
-
Further integration with the [dev] plugin.
\PMVC\plug('dev')->debug_with_cli(); \PMVC\d(/*something*/);
Install with Composer
1. Download composer
- mkdir test_folder
- curl -sS https://getcomposer.org/installer | php
2. Install by composer.json or use command-line directly
2.1 Install by composer.json
- vim composer.json
{ "require": { "pmvc-plugin/unit": "dev-master" } }
- php composer.phar install
2.2 Or use composer command-line
- php composer.phar require pmvc-plugin/unit
- or
- composer require pmvc-plugin/unit