Merge pull request woocommerce/woocommerce-admin#4 from woocommerce/add/phpunit

PHPUnit: Update setup to ensure Gutenberg is loaded
This commit is contained in:
Kelly Dwan 2018-05-04 14:51:56 -04:00 committed by GitHub
commit 549af77be8
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="tests/bootstrap.php"
backupGlobals="false"
@ -6,9 +6,11 @@
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true"
syntaxCheck="true"
>
<testsuites>
<testsuite>
<testsuite name="Woo Dash Test Suite">
<directory prefix="test-" suffix=".php">./tests/</directory>
</testsuite>
</testsuites>

View File

@ -23,6 +23,7 @@ require_once $_tests_dir . '/includes/functions.php';
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {
require dirname( dirname( dirname( __FILE__ ) ) ) . '/gutenberg/gutenberg.php';
require dirname( dirname( __FILE__ ) ) . '/woo-dash.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );