示例#1
0
 public function testSetWith()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter, &$value) {
         $asserter->setWith($value = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s is not an array'), $asserter->getTypeOf($value)))->object($asserter->setWith($value = array()))->isIdenticalTo($asserter)->array($asserter->getValue())->isEqualTo($value)->variable($asserter->getKey())->isNull()->variable($asserter->getInnerAsserter())->isNull()->variable($asserter->getInnerValue())->isNull()->boolean($asserter->isSetByReference())->isFalse()->if($asserter->object)->then->variable($innerAsserter = $asserter->getInnerAsserter())->isNotNull()->object($objectAsserter = $asserter->setWith($object = new \mock\object()))->isIdenticalTo($innerAsserter)->object($objectAsserter->getValue())->isIdenticalTo($object)->variable($asserter->getValue())->isNull()->boolean($asserter->wasSet())->isFalse()->boolean($asserter->isSetByReference())->isFalse()->variable($asserter->getKey())->isNull()->variable($asserter->getInnerAsserter())->isNull()->variable($asserter->getInnerValue())->isNull();
 }