Exemplo n.º 1
0
 public function testSecondsSetter()
 {
     $d = Interval::create(4, 5, 6, 5, 8, 9, 10);
     $d->seconds = 34;
     $this->assertSame(34, $d->seconds);
 }
Exemplo n.º 2
0
 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());
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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);
 }