From 6aa1a407dbb9050ac4c24bc08843ea89467f7da0 Mon Sep 17 00:00:00 2001 From: Bero Date: Thu, 29 Feb 2024 12:53:23 +0100 Subject: [PATCH 1/2] Default url rewrites to /index.php --- .../node/src/test/php-request-handler.spec.ts | 36 ++++++++++++++++--- .../universal/src/lib/php-request-handler.ts | 15 ++++---- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/packages/php-wasm/node/src/test/php-request-handler.spec.ts b/packages/php-wasm/node/src/test/php-request-handler.spec.ts index 91c6817965..d10d1f2991 100644 --- a/packages/php-wasm/node/src/test/php-request-handler.spec.ts +++ b/packages/php-wasm/node/src/test/php-request-handler.spec.ts @@ -142,7 +142,7 @@ describe.each(SupportedPHPVersions)( */ php.writeFile( '/index.php', - ` { php.writeFile( '/index.php', - ` { await php.writeFile( '/index.php', - ` { + php.writeFile('/test.php', ` { + php.writeFile('/index.php', ` { + php.mkdirTree('/folder'); + php.writeFile('/folder/index.php', ` Date: Fri, 1 Mar 2024 09:58:17 +0100 Subject: [PATCH 2/2] Add query string tests --- .../node/src/test/php-request-handler.spec.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/php-wasm/node/src/test/php-request-handler.spec.ts b/packages/php-wasm/node/src/test/php-request-handler.spec.ts index d10d1f2991..a44501791e 100644 --- a/packages/php-wasm/node/src/test/php-request-handler.spec.ts +++ b/packages/php-wasm/node/src/test/php-request-handler.spec.ts @@ -236,32 +236,32 @@ describe.each(SupportedPHPVersions)( expect((await response2).httpStatusCode).toEqual(502); }); - it('should return 200 when a valid request is made to a PHP file', async () => { - php.writeFile('/test.php', ` { + php.writeFile('/test.php', ` { - php.writeFile('/index.php', ` { + php.writeFile('/index.php', ` { + it('should return 200 and pass query strings when a valid request is made to a folder', async () => { php.mkdirTree('/folder'); - php.writeFile('/folder/index.php', `