mageekguy\atoum\tests\units\asserters\dateTime::testHasDateAndTime PHP Method

testHasDateAndTime() public method

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