mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
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.
This commit is contained in:
1 parent
abaf46790e
commit
93a36f2ba3
3 files changed
+3
-13
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user