PHPackages                             aaemnnosttv/wordpress-tests-core - 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. aaemnnosttv/wordpress-tests-core

Abandoned → [wp-phpunit/wp-phpunit](/?search=wp-phpunit%2Fwp-phpunit)ArchivedWordpress-tests-core[Testing &amp; Quality](/categories/testing)

aaemnnosttv/wordpress-tests-core
================================

WordPress core PHPUnit test library

91.1k2[2 issues](https://github.com/aaemnnosttv/wordpress-tests-core/issues)PHP

Since Jun 2Pushed 8y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

WordPress Tests Core
====================

[](#wordpress-tests-core)

WordPress Core PHPUnit Test Library made installable via Composer!

Usage
-----

[](#usage)

Example project's `composer.json`

```
{
    "require": {
        "johnpbloch/wordpress": "*"
    },
    "require-dev": {
        "aaemnnosttv/wordpress-tests-core": "*",
        "phpunit/phpunit": "*"
    },
    "extra": {
        "wordpress-install-dir": "web/wp",
        "wordpress-tests-core-dir": "tests/core"
    }
}

```

> Astrisk versions used for timelessness... You should use a version constraint appropriate for your needs.

#### Example project file structure

[](#example-project-file-structure)

```
├── composer.json
├── phpunit.xml
└──  tests
   ├── wp-tests-config.php [REQUIRED]
   └── core
       ├── bootstrap.php
       ├── ...

```

`tests/core` could be any directory, but it must be defined under the `extra` key as shown above.

#### `wp-tests-config.php`

[](#wp-tests-configphp)

This file is the equivalent of `wp-config.php` when running your PHPUnit tests. Due to the limitations imposed by the WordPress core bootstrap.php file, this file *must* be located as a sibling of the directory specified at `wordpress-tests-core-dir` as shown above.

Then you may simply bootstrap PHPUnit with the WordPress core bootstrap file directly.

#### Example `phpunit.xml` excerpt

[](#example-phpunitxml-excerpt)

```
