Example #1
0
$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);
// @Test: isntSame() throws no exception when comparing doubles with strings (1)
// fixtures
$actual = new LimeTesterDouble(1.0);
$expected = new LimeTesterString('1.0');
// test
$actual->isntSame($expected);
// @Test: isntSame() throws no exception when comparing doubles with strings (2)
// fixtures
$actual = new LimeTesterString('1.0');
$expected = new LimeTesterDouble(1.0);
// test
$actual->isntSame($expected);
Example #2
0
}
$t = new LimeTest();
// @Test: __toString() returns the string in quotes
$actual = new LimeTesterString('a\\d');
$t->is($actual->__toString(), "'a\\d'", 'The string in quotes is returned');
// @Test: like() throws an exception if the regular expression does not match
// fixtures
$actual = new LimeTesterString('a');
$expected = new LimeTesterString('/\\d/');
// test
$t->expect('LimeAssertionFailedException');
$actual->like($expected);
// @Test: like() throws no exception if the regular expression does match
// fixtures
$actual = new LimeTesterString('1');
$expected = new LimeTesterString('/\\d/');
// test
$actual->like($expected);
// @Test: unlike() throws an exception if the regular expression does match
// fixtures
$actual = new LimeTesterString('1');
$expected = new LimeTesterString('/\\d/');
// test
$t->expect('LimeAssertionFailedException');
$actual->unlike($expected);
// @Test: unlike() throws no exception if the regular expression does not match
// fixtures
$actual = new LimeTesterString('a');
$expected = new LimeTesterString('/\\d/');
// test
$actual->unlike($expected);