PHPackages                             ackintosh/wptestcase - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. ackintosh/wptestcase

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

ackintosh/wptestcase
====================

Testing tool for WordPress.

07PHP

Since Jul 27Pushed 12y ago1 watchersCompare

[ Source](https://github.com/ackintosh/wptestcase)[ Packagist](https://packagist.org/packages/ackintosh/wptestcase)[ RSS](/packages/ackintosh-wptestcase/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#WPTestCase

Testing tool with fixture feature for WordPress plugin development, based on the PHPUnit.

[](http://phpunit.de/manual/3.7/en/index.html)

\##Installation `composer.json`

```
{
    "require": {
        "ackintosh/wptestcase": "dev-master"
    }
}

```

```
$ php composer.phar install

```

\##Usage

- Install this tool.

```
$ cd wordpress/wp-content/plugins
$ php composer.phar install

```

- Set up tables for testing that was changed to 'wptest\_' a prefix.

[![Set up tables](https://camo.githubusercontent.com/56b6c32c80208d7b22ae3458b9d6b2610a99304ccba7bce8c5865acbf10e9be8/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f32323038333534382f6769746875622f777074657374636173652f707265706172655f7461626c65732e706e67)](https://camo.githubusercontent.com/56b6c32c80208d7b22ae3458b9d6b2610a99304ccba7bce8c5865acbf10e9be8/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f32323038333534382f6769746875622f777074657374636173652f707265706172655f7461626c65732e706e67)

- Prepare the fixture file written in YAML.

`post_fixture.yml`

```
-
  post_title: Test post title 1
  post_content: Test post content 1
  post_status: publish
-
  post_title: Test post title 2
  post_content: Test post content 2
  post_status: publish
```

Available parameters are the same as 'wp\_insert\_post' function.

[Function Reference/wp insert post](http://codex.wordpress.org/Function_Reference/wp_insert_post)

- Write test code.

```
class SamplePluginTest extends Ackintosh\WPTestCase
{

    // The table prefix for testing can be changed.
    // protected $test_prefix = 'wptest_';

    public function test_insert_post()
    {
        // Loading data.
        $this->setPostFixture(__DIR__ . '/post_fixture.yml');

        // We can get the post data that inserted by the fixture function.
        $posts = get_posts();

        // Can use all features in PHPUnit.
        $this->assertEquals($expect, $result);
    }
}
```

- Run the tests.

```
$ vendor/bin/phpunit

```

\##Requirements

- PHP 5.3 or greater

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dc303a4e1468251aac12750a7a34778a247adcbbb664ccc8cdf503705ec78c8?d=identicon)[ackintosh](/maintainers/ackintosh)

---

Top Contributors

[![ackintosh](https://avatars.githubusercontent.com/u/1885716?v=4)](https://github.com/ackintosh "ackintosh (1 commits)")

### Embed Badge

![Health badge](/badges/ackintosh-wptestcase/health.svg)

```
[![Health](https://phpackages.com/badges/ackintosh-wptestcase/health.svg)](https://phpackages.com/packages/ackintosh-wptestcase)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
