EpicMan
A developer-focused toolkit for testing, diagnosing, and troubleshooting WordPress applications.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ephpicman/testsuite/archive/refs/heads/main.zipA standalone unit-testing toolkit for WordPress developers.
Test Suite provides a lightweight PHPUnit-like testing API that runs inside WordPress. It does not require Composer, PHPUnit, or external testing dependencies.
Current focus
The current project is intentionally focused on one problem:
Let WordPress developers write unit tests, run them from the WordPress admin, and get useful failure information without installing PHPUnit.
The test API is deliberately familiar to developers who know PHPUnit, while the implementation remains independent.
Example
A developer can create a test class such as:
use EphpicMan\EphpicMan\UnitTesting\UnitTest;
final class CalculatorTest extends UnitTest
{
public function testAddition(): void
{
$actual = 2 + 3;
$this->assertSame(5, $actual);
}
}
Test methods are public methods whose names start with test.
Assertions
The current API includes:
assertSame()assertEquals()assertTrue()assertFalse()assertNull()assertNotNull()assertInstanceOf()assertCount()assertContains()
Each assertion contributes to the assertion count. When an assertion fails, the result retains:
- failure message
- expected value
- actual value
Unexpected exceptions are reported separately as errors.
Test lifecycle
Each test method gets:
setUp()- the test method
tearDown()
The runner records:
- test class
- test method
- pass/fail/error state
- assertion count
- duration
- failure information
Registering tests from another plugin
A plugin can register its own test directory:
add_filter('ephpicman_test_directories', function (array $directories): array {
$directories[] = __DIR__ . '/tests';
return $directories;
});
The directory should contain files ending in Test.php, with test classes extending UnitTest.
WordPress admin
Tests are executed from the Unit Testing admin page. There is no CLI requirement.
The admin result view shows:
- total tests
- passed tests
- failed tests
- assertion count
- execution time
- failure details
- expected and actual values
- unexpected errors
Design constraints
This project intentionally does not depend on:
- Composer
- PHPUnit
- external test runners
- external assertion libraries
The goal is not to reproduce every PHPUnit feature. The goal is to provide the smallest useful PHPUnit-like experience for WordPress developers.
Development
The project itself uses its own test framework for its framework tests.
PHP and WordPress are the only runtime requirements.
Licence
Test Suite is free software licensed under the GNU General Public License v3.0.
See the LICENSE file for the full licence text.