예제 #1
0
파일: DiffTest.php 프로젝트: hmlb/date
 public function testDiffFilteredNegativeWithSignWithMutated()
 {
     $dt = Date::createFromDate(2000, 1, 31);
     $this->assertSame(-4, $dt->diffFiltered(Interval::week(), function (Date $date) {
         return $date->getMonth() === 12;
     }, $dt->copy()->subMonths(3), false));
 }
예제 #2
0
파일: ConstructTest.php 프로젝트: hmlb/date
 public function testWeeks()
 {
     $ci = new Interval(0, 0, 1);
     $this->assertInstanceOfInterval($ci);
     $this->assertInterval($ci, 0, 0, 7, 0, 0, 0);
     $ci = Interval::weeks(2);
     $this->assertInstanceOfInterval($ci);
     $this->assertInterval($ci, 0, 0, 14, 0, 0, 0);
     $ci = Interval::week();
     $this->assertInstanceOfInterval($ci);
     $this->assertInterval($ci, 0, 0, 7, 0, 0, 0);
     $ci = Interval::week(3);
     $this->assertInstanceOfInterval($ci);
     $this->assertInterval($ci, 0, 0, 21, 0, 0, 0);
 }