1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 10:33:18 +01:00
guzzle/tests/Guzzle/Tests/Plugin/Backoff/ConstantBackoffStrategyTest.php
Michael Dowling 0e54bf303d [Backoff] Fixing the backoff plugin so that there is now a delineation between decision making strategies and calculating strategies
Moving the truncated backoff strategy up in the default exponential backoff chain
2012-10-15 16:37:50 -07:00

21 lines
659 B
PHP

<?php
namespace Guzzle\Tests\Plugin\Backoff;
use Guzzle\Plugin\Backoff\ConstantBackoffStrategy;
/**
* @covers Guzzle\Plugin\Backoff\ConstantBackoffStrategy
*/
class ConstantBackoffStrategyTest extends \Guzzle\Tests\GuzzleTestCase
{
public function testRetriesWithConstantDelay()
{
$strategy = new ConstantBackoffStrategy(3.5);
$this->assertFalse($strategy->makesDecision());
$request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
$this->assertEquals(3.5, $strategy->getBackoffPeriod(0, $request));
$this->assertEquals(3.5, $strategy->getBackoffPeriod(1, $request));
}
}