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

ActiveWordpress-tests-core[Testing &amp; Quality](/categories/testing)

emeraldjava/wordpress-tests-core
================================

WordPress core PHPUnit test library

v1.0(8y ago)021GPL-2.0+PHP

Since Jul 27Pushed 8y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

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

[](#wordpress-tests-core)

WordPress Core PHPUnit Test Library made installable via Composer! Note the module will load the wp-config.php file and execute tests against the real database.

See

-
-

Usage
-----

[](#usage)

Example project's `composer.json`

```
{
    "require": {
        "johnpbloch/wordpress": "*"
    },
    "require-dev": {
        "emeraldjava/wordpress-tests-core": "dev-master",
        "phpunit/phpunit": "*"
    },
    "extra": {
        "wordpress-install-dir": "./../../",
        "wordpress-tests-core-dir": "./tests"
    }
}

```

> 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)

```
