Skip to content

Commit

Permalink
Add test case which reproduces the issue #29
Browse files Browse the repository at this point in the history
  • Loading branch information
ackintosh committed Dec 23, 2018
1 parent ea20203 commit 5104939
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/Ackintosh/Ganesha/StorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use Ackintosh\Ganesha;
use Ackintosh\Ganesha\Storage\Adapter\Memcached;
use Ackintosh\Ganesha\Storage\Adapter\Redis;

class StorageTest extends \PHPUnit_Framework_TestCase
{
Expand All @@ -23,4 +24,22 @@ public function savesStatus()
$storage->setStatus($service, Ganesha::STATUS_TRIPPED);
$this->assertSame($storage->getStatus($service), Ganesha::STATUS_TRIPPED);
}

/**
* @test
*/
public function getLastFailureTimeWithRollingTimeWindow()
{
$r = new \Redis();
$r->connect(
getenv('GANESHA_EXAMPLE_REDIS') ? getenv('GANESHA_EXAMPLE_REDIS') : 'localhost'
);
$r->flushAll();
$storage = new Storage(new Redis(($r)), null);

$service = 'test';
$storage->incrementFailureCount($service);

$this->assertNotNull($storage->getLastFailureTime($service));
}
}

0 comments on commit 5104939

Please sign in to comment.