예제 #1
0
 public function testSameValueAs()
 {
     $date1 = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(3));
     $date2 = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(3));
     $date3 = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(5));
     $this->assertTrue($date1->sameValueAs($date2));
     $this->assertFalse($date1->sameValueAs($date3));
     $mock = $this->getMock('EmbarkNow\\ValueObjects\\ValueObjectInterface');
     $this->assertFalse($date1->sameValueAs($mock));
 }
예제 #2
0
 public function testGetDate()
 {
     $date = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(3));
     $time = new Time(new Hour(20), new Minute(50), new Second(10));
     $dateTime = new DateTime($date, $time);
     $this->assertTrue($date->sameValueAs($dateTime->getDate()));
 }