@@ -6,6 +6,7 @@ import { join } from "node:path"
66
77import { buildWordPressPhpunitRecipe } from "../packages/runtime-core/src/recipe-builders.js"
88import { corePhpunitRunCode , phpunitRunCode } from "../packages/runtime-playground/src/phpunit-command-handlers.js"
9+ import { runPhpunitCommand } from "../packages/runtime-playground/src/wordpress-command-runners.js"
910import { recipePolicy } from "../packages/cli/src/recipe-validation.js"
1011import { recipeExtraPluginSourceSubpath } from "../packages/cli/src/recipe-sources.js"
1112import { recipeInputMountPathMap , rewriteInputMountPathArgs } from "../packages/cli/src/commands/recipe-runtime-setup.js"
@@ -156,6 +157,28 @@ assert.equal(projectModeCode.match(/return array\(\$directories, \$suffixes, \$p
156157assert . equal ( projectModeCode . match ( / r e t u r n \$ r e t u r n _ v a l u e s \( \) ; / g) ?. length , 3 )
157158assertPhpunitParseConfigFallbacksReturnFiveTuple ( projectModeCode , "wp_codebox_phpunit_parse_config" , "pg_log" )
158159
160+ let capturedDefaultProjectCode = ""
161+ await runPhpunitCommand ( {
162+ artifactRoot : mkdtempSync ( join ( tmpdir ( ) , "wp-codebox-phpunit-artifacts-" ) ) ,
163+ mounts : [ ] ,
164+ runPlaygroundCommand : async ( _command , _server , input ) => {
165+ capturedDefaultProjectCode = input . code
166+ return { text : "ok" , exitCode : 0 }
167+ } ,
168+ server : { playground : { } } as never ,
169+ spec : {
170+ command : "wordpress.phpunit" ,
171+ args : [
172+ "plugin-slug=ai-provider-for-openai" ,
173+ "bootstrap-mode=project" ,
174+ "phpunit-xml=phpunit.xml.dist" ,
175+ "test-file=tests/unit/Models/OpenAiEmbeddingGenerationModelTest.php" ,
176+ ] ,
177+ } ,
178+ } )
179+ assert . ok ( capturedDefaultProjectCode . includes ( '$autoload_file = "";' ) )
180+ assert . ok ( capturedDefaultProjectCode . includes ( "NOTICE:project bootstrap mode continuing without configured PHPUnit harness autoload" ) )
181+
159182const coreModeCode = corePhpunitRunCode ( {
160183 coreRoot : "/wordpress" ,
161184 testsDir : "/wordpress/tests/phpunit" ,
0 commit comments