Skip to content

Commit 205dd76

Browse files
Merge pull request #55 from Flimm/improve-error-message
Improve error message when running phpunit
2 parents ef24e84 + f1d4fbc commit 205dd76

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

templates/plugin-bootstrap.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ if ( ! $_tests_dir ) {
1010
$_tests_dir = '/tmp/wordpress-tests-lib';
1111
}
1212

13+
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
14+
throw new Exception( "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" );
15+
}
16+
1317
// Give access to tests_add_filter() function.
1418
require_once $_tests_dir . '/includes/functions.php';
1519

templates/theme-bootstrap.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ if ( ! $_tests_dir ) {
1010
$_tests_dir = '/tmp/wordpress-tests-lib';
1111
}
1212

13+
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
14+
throw new Exception( "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" );
15+
}
16+
1317
// Give access to tests_add_filter() function.
1418
require_once $_tests_dir . '/includes/functions.php';
1519

0 commit comments

Comments
 (0)