Skip to content

Commit

Permalink
Added RR_VERSION env to Environment class
Browse files Browse the repository at this point in the history
Signed-off-by: Plakhotnikov Vladimir <v.plahotnikov@yclients.tech>
  • Loading branch information
Plakhotnikov Vladimir committed Jun 1, 2024
1 parent a876695 commit 2438034
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/Unit/EnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,23 @@ public function testGetRPCAddressWithValue(): void
$this->assertEquals('rpc_value', $env->getRPCAddress());
}

public function testGetVersionWithValue(): void
{
$env = new Environment(['RR_VERSION' => '2024.1.3']);
$this->assertEquals('2024.1.3', $env->getVersion());
}

public function testFromGlobals(): void
{
$_ENV['RR_MODE'] = 'global_mode';
$_SERVER['RR_RELAY'] = 'global_relay';
$_SERVER['RR_VERSION'] = 'global_version';

$env = Environment::fromGlobals();

$this->assertEquals('global_mode', $env->getMode());
$this->assertEquals('global_relay', $env->getRelayAddress());
$this->assertEquals('global_version', $env->getVersion());
$this->assertEquals('tcp://127.0.0.1:6001', $env->getRPCAddress());
}
}

0 comments on commit 2438034

Please sign in to comment.