public function is(LimeTesterInterface $expected) { // allow comparison with objects that implement __toString() if ($expected instanceof LimeTesterObject) { $expected->is($this); } else { parent::is($expected); } }
// test $actual->is($expected); // @Test: is() throws an exception when comparing arrays with scalars (1) // fixtures $actual = new LimeTesterArray(array()); $expected = new LimeTesterScalar(false); // test $t->expect('LimeAssertionFailedException'); $actual->is($expected); // @Test: is() throws an exception when comparing arrays with scalars (2) // fixtures $actual = new LimeTesterScalar(false); $expected = new LimeTesterArray(array()); // test $t->expect('LimeAssertionFailedException'); $actual->is($expected); // @Test: is() throws an exception when comparing arrays with objects (1) // fixtures $actual = new LimeTesterArray(array()); $expected = new LimeTesterObject(new stdClass()); // test $t->expect('LimeAssertionFailedException'); $actual->is($expected); // @Test: is() throws an exception when comparing arrays with objects (2) // fixtures $actual = new LimeTesterObject(new stdClass()); $expected = new LimeTesterArray(array()); // test $t->expect('LimeAssertionFailedException'); $actual->is($expected); // @Test: isnt() throws no exception when comparing objects with scalars (1)