public function testHasNestedException() { $this->if($asserter = new sut($generator = new asserter\generator()))->then->boolean($asserter->wasSet())->isFalse()->exception(function () use($asserter) { $asserter->hasNestedException(); })->isInstanceOf('logicException')->hasMessage('Exception is undefined')->if($asserter->setWith(new atoum\exceptions\runtime('', 0)))->then->exception(function () use($asserter) { $asserter->hasNestedException(); })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($generator->getLocale()->_('exception does not contain any nested exception'))->exception(function () use($asserter) { $asserter->hasNestedException(new \exception()); })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($generator->getLocale()->_('exception does not contain this nested exception'))->if($asserter->setWith(new atoum\exceptions\runtime('', 0, $nestedException = new \exception())))->then->object($asserter->hasNestedException())->isIdenticalTo($asserter)->object($asserter->hasNestedException($nestedException))->isIdenticalTo($asserter)->exception(function () use($asserter) { $asserter->hasNestedException(new \exception()); })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($generator->getLocale()->_('exception does not contain this nested exception')); }