Skip to content

Commit

Permalink
configuration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed Dec 23, 2024
1 parent 3c08318 commit 9ded7c9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/Unit/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,32 @@

class ConfigurationTest extends TestCase
{
public function testExponentialDelay()
{
$configuration = new Configuration([
'delayMode' => Configuration::DELAY_EXPONENTIAL,
]);

$this->assertSame($configuration->getDelayMode(), Configuration::DELAY_EXPONENTIAL);

$start = microtime(true);
$configuration->delay(0);
$this->assertLessThan(0.01, microtime(true) - $start);
}

public function testInvalidDelayConfiguration()
{
$configuration = new Configuration();
$this->expectExceptionMessage("Invalid mode: dreaming");
$configuration->setDelay(1, 'dreaming');
}

public function testInvalidConfiguration()
{
$this->expectExceptionMessage("Invalid config option hero");
new Configuration(['hero' => true]);
}

public function testClientConfigurationToken()
{
$connection = new Configuration(['token' => 'zzz']);
Expand Down

0 comments on commit 9ded7c9

Please sign in to comment.