Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ $changed_test_files_raw = ${JSON.stringify(JSON.stringify(options.changedTestFil
$phpunit_args_raw = json_decode(${JSON.stringify(JSON.stringify(options.phpunitArgs))}, true);
$bench_env = json_decode(${JSON.stringify(JSON.stringify(options.env))}, true);
$wp_config_defines = json_decode(${JSON.stringify(JSON.stringify(options.wpConfigDefines))}, true);
$dep_mounts = ${JSON.stringify(options.dependencyMounts.join("\\n"))};
$dep_mounts = ${JSON.stringify(options.dependencyMounts.join("\n"))};
$bootstrap_files = json_decode(${JSON.stringify(JSON.stringify(options.bootstrapFiles))}, true);
$preload_files = json_decode(${JSON.stringify(JSON.stringify(options.preloadFiles ?? []))}, true);
$bootstrap_mode = ${JSON.stringify(options.bootstrapMode || "managed")};
Expand Down
3 changes: 2 additions & 1 deletion tests/phpunit-project-autoload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ const managedModeCode = phpunitRunCode({
phpunitArgs: [],
env: {},
wpConfigDefines: {},
dependencyMounts: [],
dependencyMounts: ["/wordpress/wp-content/plugins/demo-plugin", "/wordpress/wp-content/plugins/dependency"],
bootstrapFiles: [],
bootstrapMode: "managed",
projectBootstrap: "",
Expand All @@ -410,6 +410,7 @@ const managedModeCode = phpunitRunCode({

assert.ok(managedModeCode.includes("configured PHPUnit harness autoload file is not readable"))
assert.ok(managedModeCode.includes("'cacheResult' => false"))
assert.ok(managedModeCode.includes('$dep_mounts = "/wordpress/wp-content/plugins/demo-plugin\\n/wordpress/wp-content/plugins/dependency";'), "dependency mounts must be newline-delimited for the generated PHP runner")
const installStageIndex = managedModeCode.indexOf("pg_run_install_stage(array(")
const dependencyLoadStageIndex = managedModeCode.indexOf("$loaded_dep_files = pg_run_load_deps_stage", installStageIndex)
const activationStageIndex = managedModeCode.indexOf("pg_run_activation_stage", dependencyLoadStageIndex)
Expand Down
8 changes: 5 additions & 3 deletions tests/playground-phpunit-readonly-cache.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ try {
const recipe = buildWordPressPhpunitRecipe({
pluginSlug: "readonly-phpunit-fixture",
extra_plugins: [{
source: plugin,
slug: "readonly-phpunit-fixture",
activate: false,
}, {
source: dependency,
slug: "activation-dependency",
pluginFile: "activation-dependency/activation-dependency.php",
activate: false,
}],
dependencyMounts: ["/wordpress/wp-content/plugins/activation-dependency"],
dependencyMounts: ["/wordpress/wp-content/plugins/readonly-phpunit-fixture", "/wordpress/wp-content/plugins/activation-dependency"],
mounts: [
{ source: plugin, target: "/wordpress/wp-content/plugins/readonly-phpunit-fixture", mode: "readonly" },
{ source: join(harness, "vendor"), target: "/wp-codebox-vendor", mode: "readonly" },
],
})
Expand Down
Loading