public function testSecondsSetter() { $d = Interval::create(4, 5, 6, 5, 8, 9, 10); $d->seconds = 34; $this->assertSame(34, $d->seconds); }
public function testYearsAndMonthsInDanish() { Interval::setLocale('da'); $this->assertSame('1 år 1 måned', Interval::create(1, 1)->forHumans()); $this->assertSame('2 år 1 måned', Interval::create(2, 1)->forHumans()); }
public function testAddWithNegativeDiffInterval() { $diff = Date::now()->diff(Date::now()->subWeeks(3)); $ci = Interval::create(4, 3, 6, 7, 8, 10, 11)->add($diff); $this->assertInterval($ci, 4, 3, 28, 8, 10, 11); }
public function testAllWithCreate() { $ci = Interval::create(5, 6, 2, 5, 9, 10, 11); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 5, 6, 19, 9, 10, 11); }