Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Latest Unstable Version CircleCI License Total Downloads

A simple phpunit wrapper let it support phpunit 4.8.36, 8.5.52, ^9.6, ^10.5, ^11.5

In another word.

You could use is cross php version 5.6 -> 8.x+

function mapping table

phpunit PMVC/unit
__construct pmvc_init
setup pmvc_setup
teardown pmvc_teardown
assertContains haveString
assertStringContainsString haveString
assertStringContainsString haveString
getMockBuilder getPMVCMockBuilder
setMethods pmvc_onlyMethods
onlyMethods pmvc_onlyMethods

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

PHPUnit Tip

  • Show event
phpunit --log-events-text php://stdout
  • show deprecations
phpunit --display-deprecations --testdox

Install with Composer

1. Download composer

2. Install by composer.json or use command-line directly

2.1 Install by composer.json

  • vim composer.json
{
    "require": {
        "pmvc-plugin/unit": "dev-main"
    }
}
  • php composer.phar install

2.2 Or use composer command-line

  • php composer.phar require pmvc-plugin/unit
  • or
    • composer require pmvc-plugin/unit

Other Polyfills

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages