예제 #1
0
파일: DiffTest.php 프로젝트: hmlb/date
 public function testDiffFilteredUsingMinutesPositiveWithMutated()
 {
     $dt = Date::createFromDate(2000, 1, 1)->startOfDay();
     $this->assertSame(60, $dt->diffFiltered(Interval::minute(), function (Date $date) {
         return $date->getHour() === 12;
     }, Date::createFromDate(2000, 1, 1)->endOfDay()));
 }
예제 #2
0
파일: ConstructTest.php 프로젝트: hmlb/date
 public function testMinutes()
 {
     $ci = new Interval(0, 0, 0, 0, 0, 1);
     $this->assertInstanceOfInterval($ci);
     $this->assertInterval($ci, 0, 0, 0, 0, 1, 0);
     $ci = Interval::minutes(2);
     $this->assertInstanceOfInterval($ci);
     $this->assertInterval($ci, 0, 0, 0, 0, 2, 0);
     $ci = Interval::minute();
     $this->assertInstanceOfInterval($ci);
     $this->assertInterval($ci, 0, 0, 0, 0, 1, 0);
     $ci = Interval::minute(3);
     $this->assertInstanceOfInterval($ci);
     $this->assertInterval($ci, 0, 0, 0, 0, 3, 0);
 }