mageekguy\atoum\tests\units\asserters\dateTime::testHasTime PHP Метод

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

public testHasTime ( )
        public function testHasTime()
        {
            $this->given($asserter = $this->newTestedInstance->setLocale($locale = new \mock\atoum\locale()))->then->exception(function () use($asserter) {
                $asserter->hasTime(1, 2, 3);
            })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Value is not an instance of \\dateTime or \\dateTimeInterface')->if($asserter->setWith($dateTime = new \DateTime('01:02:03')))->then->object($asserter->hasTime('01', '02', '03'))->isIdenticalTo($asserter)->object($asserter->hasTime('1', '2', '3'))->isIdenticalTo($asserter)->object($asserter->hasTime(1, 2, 3))->isIdenticalTo($asserter)->if($this->calling($locale)->_ = $badTime = uniqid())->then->exception(function () use($asserter) {
                $asserter->hasTime(4, 5, 6);
            })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($badTime)->mock($locale)->call('_')->withArguments('Time is %s instead of %s', '01:02:03', '04:05:06')->once->exception(function () use($asserter, &$failMessage) {
                $asserter->hasTime(4, 5, 6, $failMessage = uniqid());
            })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($failMessage);
        }