public convertTokensToSeconds ( integer $tokens ) : double | ||
$tokens | integer | The amount of tokens. |
return | double | The seconds. |
public function convertTokensToSeconds($tokens)
{
return $tokens / $this->rate->getTokensPerSecond();
}
/** * Tests convertTokensToSeconds(). * * @param double $expected The expected seconds. * @param int $tokens The tokens. * @param Rate $rate The rate. * * @test * @dataProvider provideTestconvertTokensToSeconds */ public function testconvertTokensToSeconds($expected, $tokens, Rate $rate) { $converter = new TokenConverter($rate); $this->assertEquals($expected, $converter->convertTokensToSeconds($tokens)); }