hasTime() public method

public hasTime ( $hours, $minutes, $seconds, $failMessage = null )
Exemplo n.º 1
0
 public function testHasTime()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->hasTime(1, 2, 3);
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Instance of \\dateTime is undefined')->if($asserter->setWith($dateTime = new \DateTime('01:02:03')))->then->exception(function () use(&$line, $asserter) {
         $line = __LINE__;
         $asserter->hasTime(4, 5, 6);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('Time is %s instead of %s'), '01:02:03', '04:05:06'))->object($asserter->hasTime('01', '02', '03'))->isIdenticalTo($asserter)->object($asserter->hasTime('1', '2', '3'))->isIdenticalTo($asserter)->object($asserter->hasTime(1, 2, 3))->isIdenticalTo($asserter);
 }