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

testHasTimezone() public method

public testHasTimezone ( )
        public function testHasTimezone()
        {
            $this->given($asserter = $this->newTestedInstance->setLocale($locale = new \mock\atoum\locale()))->then->exception(function () use($asserter) {
                $asserter->hasTimezone(new \DateTimezone('Europe/London'));
            })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Value is not an instance of \\dateTime or \\dateTimeInterface')->if($asserter->setWith($dateTime = new \DateTime('now', $timezone = new \DateTimezone('Europe/Paris'))))->then->object($asserter->hasTimezone($dateTime->getTimezone()))->isIdenticalTo($asserter)->if($this->calling($locale)->_ = $badTimezone = uniqid())->then->exception(function () use($asserter) {
                $asserter->hasTimezone(new \DateTimezone('Europe/London'));
            })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($badTimezone)->mock($locale)->call('_')->withArguments('Timezone is %s instead of %s', 'Europe/Paris', 'Europe/London')->once->exception(function () use($asserter, &$failMessage) {
                $asserter->hasTimezone(new \DateTimezone('Europe/London'), $failMessage = uniqid());
            })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($failMessage);
        }