From 93a36f2ba37df23efe94cd11ffdee30279ea7b35 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 13 Aug 2026 00:18:17 +0530 Subject: [PATCH] Inline the start command assertion One assertion behind a named helper only moved the reader somewhere else to find it. Assert on the encoded body at each call site instead, and drop the helpers/ check with it - that one guarded against a start command leaking under some other key name, which is a wider claim than these tests set out to make. SitesBase keeps the shape it had before this branch. --- tests/e2e/Services/Sites/SitesBase.php | 10 ---------- tests/e2e/Services/Sites/SitesCustomClientTest.php | 4 ++-- tests/e2e/Services/Sites/SitesCustomServerTest.php | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/tests/e2e/Services/Sites/SitesBase.php b/tests/e2e/Services/Sites/SitesBase.php index a01b08f414..00cc0a6cc6 100644 --- a/tests/e2e/Services/Sites/SitesBase.php +++ b/tests/e2e/Services/Sites/SitesBase.php @@ -496,14 +496,4 @@ trait SitesBase return $specification['slug']; } - - protected function assertStartCommandNotExposed(array $payload): void - { - $body = \json_encode($payload, JSON_UNESCAPED_SLASHES); - - $this->assertStringNotContainsString('startCommand', $body); - - // Every framework start command shells out to a helper script shipped in the runtime image. - $this->assertStringNotContainsString('helpers/', $body); - } } diff --git a/tests/e2e/Services/Sites/SitesCustomClientTest.php b/tests/e2e/Services/Sites/SitesCustomClientTest.php index 97f5df1e0e..1e9abcb411 100644 --- a/tests/e2e/Services/Sites/SitesCustomClientTest.php +++ b/tests/e2e/Services/Sites/SitesCustomClientTest.php @@ -129,13 +129,13 @@ final class SitesCustomClientTest extends Scope $this->assertEquals(200, $templates['headers']['status-code']); $this->assertGreaterThan(0, $templates['body']['total']); - $this->assertStartCommandNotExposed($templates['body']); + $this->assertStringNotContainsString('startCommand', (string) json_encode($templates['body'])); $template = $this->getTemplate('starter-for-nextjs'); $this->assertEquals(200, $template['headers']['status-code']); - $this->assertStartCommandNotExposed($template['body']); + $this->assertStringNotContainsString('startCommand', (string) json_encode($template['body'])); } public function testGetTemplate() diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index 02a2562627..b748a0af94 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -2272,7 +2272,7 @@ final class SitesCustomServerTest extends Scope $this->assertEquals(200, $frameworks['headers']['status-code']); $this->assertGreaterThan(0, $frameworks['body']['total']); - $this->assertStartCommandNotExposed($frameworks['body']); + $this->assertStringNotContainsString('startCommand', (string) json_encode($frameworks['body'])); } public function testCreateSiteHidesStartCommand(): void