for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SubjectivePHPTest\Durations;
use SubjectivePHP\Durations\Minutes;
use PHPUnit\Framework\TestCase;
/**
* @coversDefaultClass \SubjectivePHP\Durations\Minutes
*/
final class MinutesTest extends TestCase
{
* @test
* @covers ::inHours
public function inHoursCalculatesValue()
for ($i = 0; $i < 60; $i++) {
$this->assertSame(60 * $i, Minutes::inHours($i));
}
* @covers ::inDays
public function inDaysCalculatesValue()
$expected = 60 * 24 * $i;
$this->assertSame($expected, Minutes::inDays($i));
* @covers ::inWeeks
public function inWeeksCalculatesValue()
$expected = 60 * 24 * 7 * $i;
$this->assertSame($expected, Minutes::inWeeks($i));
* @covers ::inMonths
public function inMonthsCalculatesValue()
$expected = 60 * 24 * 30 * $i;
$this->assertSame($expected, Minutes::inMonths($i));
* @covers ::inYears
public function inYearsCalculatesValue()
$expected = 60 * 24 * 365 * $i;
$this->assertSame($expected, Minutes::inYears($i));