Skip to content

Commit

Permalink
WIP test against the lmars-dev cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Lewis Marshall <[email protected]>
  • Loading branch information
lmars committed Aug 4, 2024
1 parent 420f97d commit f718edf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/AblyRestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ public function testInitLibWithSpecifiedPort() {
public function testInitLibWithSpecifiedEnv() {
$ably = new AblyRest( [
'key' => 'fake.key:veryFake',
'environment' => 'sandbox',
'environment' => 'lmars-dev',
'httpClass' => 'tests\HttpMockInitTest',
] );
$ably->time(); // make a request
$this->assertEquals( 'https://sandbox-rest.ably.io:443/time', $ably->http->lastUrl, 'Unexpected host mismatch' );
$this->assertEquals( 'https://lmars-dev-rest.ably.io:443/time', $ably->http->lastUrl, 'Unexpected host mismatch' );
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/ClientOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ public function testWithProductionEnvironment() {
*/
public function testWithCustomEnvironment() {
$clientOptions = new ClientOptions();
$clientOptions->environment = "sandbox";
self::assertEquals('sandbox-rest.ably.io', $clientOptions->getPrimaryRestHost());
$clientOptions->environment = "lmars-dev";
self::assertEquals('lmars-dev-rest.ably.io', $clientOptions->getPrimaryRestHost());
self::assertTrue($clientOptions->tls);
self::assertEquals(443, $clientOptions->tlsPort);
$fallbackHosts = $clientOptions->getFallbackHosts();
sort($fallbackHosts);
$this->assertEquals(Defaults::getEnvironmentFallbackHosts('sandbox'), $fallbackHosts);
$this->assertEquals(Defaults::getEnvironmentFallbackHosts('lmars-dev'), $fallbackHosts);
}

/**
Expand Down
12 changes: 6 additions & 6 deletions tests/DefaultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public function testFallbackHosts() {
*/
public function testEnvironmentFallbackHosts() {
$expectedFallbackHosts = [
"sandbox-a-fallback.ably-realtime.com",
"sandbox-b-fallback.ably-realtime.com",
"sandbox-c-fallback.ably-realtime.com",
"sandbox-d-fallback.ably-realtime.com",
"sandbox-e-fallback.ably-realtime.com"
"lmars-dev-a-fallback.ably-realtime.com",
"lmars-dev-b-fallback.ably-realtime.com",
"lmars-dev-c-fallback.ably-realtime.com",
"lmars-dev-d-fallback.ably-realtime.com",
"lmars-dev-e-fallback.ably-realtime.com"
];
$fallbackHosts = Defaults::getEnvironmentFallbackHosts("sandbox");
$fallbackHosts = Defaults::getEnvironmentFallbackHosts("lmars-dev");
$this->assertEquals($expectedFallbackHosts, $fallbackHosts);
}
}
2 changes: 1 addition & 1 deletion tests/factories/TestApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct() {

$settings = [];

$settings['environment'] = getenv( 'ABLY_ENV' ) ? : 'sandbox';
$settings['environment'] = getenv( 'ABLY_ENV' ) ? : 'lmars-dev';
$settings['useBinaryProtocol'] = getenv('PROTOCOL') !== 'json';
//$settings['logLevel'] = Log::DEBUG;

Expand Down

0 comments on commit f718edf

Please sign in to comment.