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

testHasDate() public method

public testHasDate ( )
        public function testHasDate()
        {
            $this->given($asserter = $this->newTestedInstance->setLocale($locale = new \mock\atoum\locale()))->then->exception(function () use($asserter) {
                $asserter->hasDate(1976, 10, 6);
            })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Value is not an instance of \\dateTime or \\dateTimeInterface')->if($asserter->setWith($dateTime = new \DateTime('1976-10-06')))->then->object($asserter->hasDate(1976, 10, 6))->isIdenticalTo($asserter)->object($asserter->hasDate('1976', '10', '6'))->isIdenticalTo($asserter)->object($asserter->hasDate('1976', '10', '06'))->isIdenticalTo($asserter)->if($this->calling($locale)->_ = $badDate = uniqid())->then->exception(function () use($asserter) {
                $asserter->hasDate(1980, 8, 14);
            })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($badDate)->mock($locale)->call('_')->withArguments('Date is %s instead of %s', '1976-10-06', '1980-08-14')->once->exception(function () use($asserter, &$failMessage) {
                $asserter->hasDate(1980, 8, 14, $failMessage = uniqid());
            })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($failMessage);
        }