Repository: appwrite/appwrite
File: tests/e2e/Services/Sites/SitesCustomServerTest.php (PHP)

Code before:
        ]);

        $this->assertEquals(201, $secretVariable['headers']['status-code']);
        $this->assertNotEmpty($secretVariable['body']['$id']);
        $this->assertEquals('name', $secretVariable['body']['key']);
        $this->assertEquals('', $secretVariable['body']['value']);
        $this->assertEquals(true, $secretVariable['body']['secret']);

        $deploymentId = $this->setupDeployment($siteId, [
            'code' => $this->packageSite('astro'),
            'activate' => 'true'
        ]);

        $this->assertNotEmpty($deploymentId);

        $domain = $this->getSiteDomain($siteId);
        $proxyClient = new Client();
        $proxyClient->setEndpoint('http://' . $domain);

        $response = $proxyClient->call(Client::METHOD_GET, '/', array_merge([
            'content-type' => 'application/json',
            'x-appwrite-project' => $this->getProject()['$id'],
        ]));

        $this->assertEquals(200, $response['headers']['status-code']);
        $this->assertStringContainsString("Message from ENV: Appwrite", $response['body']);

        $this->cleanupSite($siteId);
    }

    public function testListSites(): void
    {
        /**
         * Test for SUCCESS
         */
        $siteId = $this->setupSite([
            'buildRuntime' => 'ssr-22',
            'fallbackFile' => null,
            'framework' => 'other',
            'name' => 'Test Site',
            'outputDirectory' => './',
            'providerBranch' => 'main',
            'providerRootDirectory' => './',
            'siteId' => ID::unique()
        ]);

        $sites = $this->listSites([
            'search' => $siteId,
        ]);

        $this->assertEquals($sites['headers']['status-code'], 200);

Review comment (suggestion):
```suggestion
        $this->assertStringContainsString("Env variable is Appwrite", $response['body']);
```

Code after:
            'activate' => 'true'
        ]);

        $this->assertNotEmpty($deploymentId);

        $domain = $this->getSiteDomain($siteId);
        $proxyClient = new Client();
        $proxyClient->setEndpoint('http://' . $domain);

        $response = $proxyClient->call(Client::METHOD_GET, '/', array_merge([
            'content-type' => 'application/json',
            'x-appwrite-project' => $this->getProject()['$id'],
        ]));

        $this->assertEquals(200, $response['headers']['status-code']);
        $this->assertStringContainsString("Env variable is Appwrite", $response['body']);
        $this->assertStringNotContainsString("Variable not found", $response['body']);

        $this->cleanupSite($siteId);
    }

    public function testListSites(): void
    {
        /**
         * Test for SUCCESS
         */
        $siteId = $this->setupSite([
            'buildRuntime' => 'ssr-22',
            'fallbackFile' => null,
            'framework' => 'other',
            'name' => 'Test Site',
            'outputDirectory' => './',
            'providerBranch' => 'main',
            'providerRootDirectory' => './',
            'siteId' => ID::unique()
        ]);

        $sites = $this->listSites([
            'search' => $siteId,
        ]);

        $this->assertEquals($sites['headers']['status-code'], 200);
        $this->assertCount(1, $sites['body']['sites']);
        $this->assertEquals($sites['body']['sites'][0]['name'], 'Test Site');

        // Test pagination limit
        $sites = $this->listSites([
            'queries' => [
                Query::limit(1)->toString(),
            ],
        ]);