strictlyNotContains() public method

public strictlyNotContains ( $value, $failMessage = null )
Exemplo n.º 1
0
 public function testStrictlyNotContains()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->contains(uniqid());
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Array is undefined')->if($asserter->setWith(array(1, 2, 3, 4, 5, '6')))->then->exception(function () use($asserter) {
         $asserter->strictlyNotContains(1);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s strictly contains %s'), $asserter, $asserter->getTypeOf(1)))->exception(function () use($asserter, &$message) {
         $asserter->strictlyNotContains(1, $message = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($message)->object($asserter->strictlyNotContains('1'))->isIdenticalTo($asserter)->object($asserter->atKey(1)->strictlyNotContains(1))->isIdenticalTo($asserter)->object($asserter->atKey(2)->strictlyNotContains(1))->isIdenticalTo($asserter)->object($asserter->atKey(3)->strictlyNotContains(1))->isIdenticalTo($asserter)->object($asserter->atKey(4)->strictlyNotContains(1))->isIdenticalTo($asserter)->exception(function () use($asserter) {
         $asserter->strictlyNotContains(1);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s strictly contains %s'), $asserter, $asserter->getTypeOf(1)))->exception(function () use($asserter) {
         $asserter->atKey(0)->strictlyNotContains(1);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s strictly contains %s at key %s'), $asserter, $asserter->getTypeOf(1), $asserter->getTypeOf(0)))->exception(function () use($asserter) {
         $asserter->atKey('0')->strictlyNotContains(1);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s strictly contains %s at key %s'), $asserter, $asserter->getTypeOf(1), $asserter->getTypeOf('0')));
 }
Exemplo n.º 2
0
 public function testStrictlyNotContains()
 {
     $this->if($asserter = new asserters\phpArray($generator = new asserter\generator()))->then->boolean($asserter->wasSet())->isFalse()->exception(function () use($asserter) {
         $asserter->contains(uniqid());
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Array is undefined')->if($asserter->setWith(array(1)))->then->exception(function () use($asserter) {
         $asserter->strictlyNotContains(1);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s contains strictly %s'), $asserter, $asserter->getTypeOf(1)))->object($asserter->strictlyNotContains('1'))->isIdenticalTo($asserter);
 }