From cd2774385ba01546b9fc6a1060642df56ae4a03c Mon Sep 17 00:00:00 2001 From: gitlost Date: Mon, 15 Jan 2018 19:53:46 +0000 Subject: [PATCH 1/2] Filter theme_root in tests/bootstrap.php. --- features/scaffold-theme-tests.feature | 36 ++++++++++++++++++++++++++- templates/theme-bootstrap.mustache | 9 +++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/features/scaffold-theme-tests.feature b/features/scaffold-theme-tests.feature index 24e76c10d..91e44def2 100644 --- a/features/scaffold-theme-tests.feature +++ b/features/scaffold-theme-tests.feature @@ -18,7 +18,7 @@ Feature: Scaffold theme unit tests """ And the {THEME_DIR}/p2child/tests/bootstrap.php file should contain: """ - register_theme_directory( dirname( $theme_dir ) ); + register_theme_directory( $theme_root ); """ And the {THEME_DIR}/p2child/tests/bootstrap.php file should contain: """ @@ -73,6 +73,40 @@ Feature: Scaffold theme unit tests executable """ + # Warning: overwriting generated functions.php file, so functions.php file loaded only tests beyond here... + Given a wp-content/themes/p2child/functions.php file: + """ + Date: Mon, 15 Jan 2018 21:42:22 +0000 Subject: [PATCH 2/2] Need to use install-wp-tests.sh before running phpunit. --- features/scaffold-theme-tests.feature | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/features/scaffold-theme-tests.feature b/features/scaffold-theme-tests.feature index 91e44def2..80cc91a86 100644 --- a/features/scaffold-theme-tests.feature +++ b/features/scaffold-theme-tests.feature @@ -78,8 +78,13 @@ Feature: Scaffold theme unit tests """