isNotIdenticalTo() public method

public isNotIdenticalTo ( $value, $failMessage = null )
Ejemplo n.º 1
0
 public function testIsNotIdenticalTo()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->isNotIdenticalTo(new \mock\object());
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Array is undefined')->if($asserter->setWith($array = array(1, 2)))->then->object($asserter->isNotIdenticalTo(array('1', 2)))->isIdenticalTo($asserter)->exception(function () use($asserter, $array) {
         $asserter->isNotIdenticalTo($array);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s is identical to %s'), $asserter, $asserter->getTypeOf($array)))->if($asserter->integer)->then->object($asserter->isNotIdenticalTo(array('1', 2)))->isIdenticalTo($asserter)->if($asserter->integer[1])->then->object($asserter->isEqualTo(2))->isIdenticalTo($asserter)->object($asserter->isEqualTo(2)->isNotEqualTo(5))->isIdenticalTo($asserter)->if($diff = new diffs\variable())->then->exception(function () use($asserter, &$expectedValue) {
         $asserter->isEqualTo($expectedValue = rand(3, PHP_INT_MAX));
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s is not equal to %s'), $asserter->getTypeOf($asserter->getInnerValue()), $asserter->getTypeOf($expectedValue)) . PHP_EOL . $diff->setExpected($expectedValue)->setActual(2));
 }