hasDate() публичный Метод

public hasDate ( $year, $month, $day, $failMessage = null )
Пример #1
0
 public function testHasDate()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->hasDate(1976, 10, 6);
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Instance of \\dateTime is undefined')->if($asserter->setWith($dateTime = new \DateTime('1976-10-06')))->then->exception(function () use(&$line, $asserter) {
         $line = __LINE__;
         $asserter->hasDate(1980, 8, 14);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('Date is %s instead of %s'), '1976-10-06', '1980-08-14'))->object($asserter->hasDate(1976, 10, 6))->isIdenticalTo($asserter)->object($asserter->hasDate('1976', '10', '6'))->isIdenticalTo($asserter)->object($asserter->hasDate('1976', '10', '06'))->isIdenticalTo($asserter);
 }