public function isnt(LimeTesterInterface $expected) { // don't compare twice to allow for cyclic dependencies if (in_array(array($this->value, $expected->value), self::$unequal, true) || in_array(array($expected->value, $this->value), self::$unequal, true)) { return; } self::$unequal[] = array($this->value, $expected->value); parent::isnt($expected); }
$expected = new LimeTesterArray(array(0 => new LimeError("message", "file", 11))); // test $actual->is($expected); // @Test: isnt() throws an exception if the arrays are equal // fixtures $actual = new LimeTesterArray(array(0 => 1)); $expected = new LimeTesterArray(array(0 => 1)); // test $t->expect('LimeAssertionFailedException'); $actual->isnt($expected); // @Test: isnt() throws no exception if the arrays differ // fixtures $actual = new LimeTesterArray(array(0 => 1, 1 => 2)); $expected = new LimeTesterArray(array(0 => 1, 1 => 3)); // test $actual->isnt($expected); // @Test: same() throws an exception if keys are missing // fixtures $actual = new LimeTesterArray(array()); $expected = new LimeTesterArray(array(0 => 1)); // test $t->expect('LimeAssertionFailedException'); $actual->same($expected); // @Test: same() throws an exception if keys are unexpected // fixtures $actual = new LimeTesterArray(array(0 => 1)); $expected = new LimeTesterArray(array()); // test $t->expect('LimeAssertionFailedException'); $actual->same($expected); // @Test: same() throws an exception if types are different