Skip to content

Commit fa6d45f

Browse files
committed
Improve name of test-related file-not-found action callback
1 parent 8fa17a8 commit fa6d45f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/php-wasm/node/src/test/php-request-handler.spec.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ describe.each(SupportedPHPVersions)(
1616
(phpVersion) => {
1717
let php: PHP;
1818
let handler: PHPRequestHandler;
19-
let getFileNotFoundActionTest: FileNotFoundGetActionCallback = () => ({
20-
type: '404',
21-
});
19+
let getFileNotFoundActionForTest: FileNotFoundGetActionCallback =
20+
() => ({
21+
type: '404',
22+
});
2223
beforeEach(async () => {
2324
handler = new PHPRequestHandler({
2425
documentRoot: '/',
2526
phpFactory: async () =>
2627
new PHP(await loadNodeRuntime(phpVersion)),
2728
maxPhpInstances: 1,
2829
getFileNotFoundAction: (relativePath: string) => {
29-
return getFileNotFoundActionTest(relativePath);
30+
return getFileNotFoundActionForTest(relativePath);
3031
},
3132
});
3233
php = await handler.getPrimaryPhp();
@@ -143,7 +144,7 @@ describe.each(SupportedPHPVersions)(
143144
];
144145
fileNotFoundFallbackTestUris.forEach((nonExtistentFileUri) => {
145146
it(`should relay a fallback response for non-existent file: '${nonExtistentFileUri}'`, async () => {
146-
getFileNotFoundActionTest = (uri: string) => {
147+
getFileNotFoundActionForTest = (uri: string) => {
147148
if (uri === nonExtistentFileUri) {
148149
return {
149150
type: 'response',
@@ -177,7 +178,7 @@ describe.each(SupportedPHPVersions)(
177178
'expected fallback content'
178179
);
179180

180-
getFileNotFoundActionTest = (uri: string) => {
181+
getFileNotFoundActionForTest = (uri: string) => {
181182
if (uri === nonExtistentFileUri) {
182183
return {
183184
type: 'internal-redirect',
@@ -201,7 +202,7 @@ describe.each(SupportedPHPVersions)(
201202
});
202203
});
203204
it(`should support responding with a plain 404 for non-existent file: '${nonExtistentFileUri}'`, async () => {
204-
getFileNotFoundActionTest = () => ({ type: '404' });
205+
getFileNotFoundActionForTest = () => ({ type: '404' });
205206
const response = await handler.request({
206207
url: nonExtistentFileUri,
207208
});
@@ -427,7 +428,8 @@ describe.each(SupportedPHPVersions)(
427428

428429
describe('WordPress requests', () => {
429430
beforeEach(() => {
430-
getFileNotFoundActionTest = getFileNotFoundActionForWordPress;
431+
getFileNotFoundActionForTest =
432+
getFileNotFoundActionForWordPress;
431433
});
432434
it('should delegate request for non-existent PHP file to /index.php with query args', async () => {
433435
php.writeFile(

0 commit comments

Comments
 (0)