Exemplo n.º 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('ValueObjects\\ValueObjectInterface');
     $this->assertFalse($date1->sameValueAs($mock));
 }
Exemplo n.º 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()));
 }