mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
draft: new router
This commit is contained in:
@@ -52,19 +52,22 @@ class HTTPTest extends Scope
|
||||
|
||||
public function testHumans()
|
||||
{
|
||||
$previousEndpoint = $this->client->getEndpoint();
|
||||
$this->client->setEndpoint("http://localhost");
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/humans.txt', \array_merge([
|
||||
'origin' => 'http://localhost',
|
||||
]), []);
|
||||
$response = $this->client->call(Client::METHOD_GET, '/humans.txt');
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertStringContainsString('# humanstxt.org/', $response['body']);
|
||||
$this->client->setEndpoint($previousEndpoint);
|
||||
}
|
||||
|
||||
public function testRobots()
|
||||
{
|
||||
$previousEndpoint = $this->client->getEndpoint();
|
||||
$this->client->setEndpoint("http://localhost");
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
@@ -74,6 +77,7 @@ class HTTPTest extends Scope
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertStringContainsString('# robotstxt.org/', $response['body']);
|
||||
$this->client->setEndpoint($previousEndpoint);
|
||||
}
|
||||
|
||||
public function testAcmeChallenge()
|
||||
@@ -99,7 +103,7 @@ class HTTPTest extends Scope
|
||||
'origin' => 'http://localhost',
|
||||
]), []);
|
||||
|
||||
$this->assertEquals(400, $response['headers']['status-code']);
|
||||
$this->assertEquals(404, $response['headers']['status-code']);
|
||||
|
||||
// Cleanup
|
||||
$this->client->setEndpoint($previousEndpoint);
|
||||
@@ -151,7 +155,10 @@ class HTTPTest extends Scope
|
||||
|
||||
public function testVersions()
|
||||
{
|
||||
/**
|
||||
$previousEndpoint = $this->client->getEndpoint();
|
||||
$this->client->setEndpoint("http://localhost");
|
||||
|
||||
/**
|
||||
* Test without header
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/versions', \array_merge([
|
||||
@@ -170,5 +177,7 @@ class HTTPTest extends Scope
|
||||
$this->assertIsString($body['server-python']);
|
||||
$this->assertIsString($body['server-ruby']);
|
||||
$this->assertIsString($body['console-cli']);
|
||||
|
||||
$this->client->setEndpoint($previousEndpoint);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user