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

testHasMonth() public method

public testHasMonth ( )
        public function testHasMonth()
        {
            $this->given($asserter = $this->newTestedInstance->setLocale($locale = new \mock\atoum\locale()))->then->exception(function () use($asserter) {
                $asserter->hasMonth(rand(0, PHP_INT_MAX));
            })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Value is not an instance of \\dateTime or \\dateTimeInterface')->if($asserter->setWith($dateTime = new \DateTime('1976-09-06')))->then->object($asserter->hasMonth('09'))->isIdenticalTo($asserter)->object($asserter->hasMonth('9'))->isIdenticalTo($asserter)->object($asserter->hasMonth(9))->isIdenticalTo($asserter)->if($this->calling($locale)->_ = $badMonth = uniqid())->then->exception(function () use($asserter) {
                $asserter->hasMonth(1);
            })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($badMonth)->mock($locale)->call('_')->withArguments('Month is %s instead of %02d', '09', 1)->once->exception(function () use($asserter, &$failMessage) {
                $asserter->hasMonth(1, $failMessage = uniqid());
            })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($failMessage);
        }