notHasKey() public method

public notHasKey ( $key, $failMessage = null )
Beispiel #1
0
 public function testNotHasKey()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->hasSize(rand(0, PHP_INT_MAX));
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Array is undefined')->if($asserter->setWith(array()))->then->object($asserter->notHasKey(1))->isIdenticalTo($asserter)->if($asserter->setWith(array(uniqid(), uniqid(), uniqid(), uniqid(), uniqid())))->then->exception(function () use($asserter) {
         $asserter->notHasKey(0);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s has a key %s'), $asserter, $asserter->getTypeOf(0)))->exception(function () use($asserter, &$message) {
         $asserter->notHasKey(0, $message = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($message)->object($asserter->notHasKey(5))->isIdenticalTo($asserter);
 }