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