set(1, "one as integer"); $cache->set("2", "two as string '2'"); $cache->set("three", "three as string"); $cache->set($object, "object"); $this->assertEquals("one as integer", $cache->get(1)); $this->assertEquals("two as string '2'", $cache->get('2')); $this->assertEquals("three as string", $cache->get('three')); $this->assertEquals("object", $cache->get($object)); $this->assertNull($cache->get(11)); $this->assertNull($cache->get('12')); $this->assertNull($cache->get('thirteen')); } public function testExists() { $object = new CacheTestToSTring; $cache = new Cache; $this->assertFalse($cache->exists(1)); $this->assertFalse($cache->exists("2")); $this->assertFalse($cache->exists("three")); $this->assertFalse($cache->exists($object)); } public function testExistsArray() { $array = array(); $cache = new Cache; $this->setExpectedException('RuntimeException'); $cache->exists($array); } public function testGetArray() { $array = array(); $cache = new Cache; $this->setExpectedException('RuntimeException'); $cache->get($array); } public function testSetArray() { $array = array(); $cache = new Cache; $this->setExpectedException('RuntimeException'); $cache->set($array, 'broken'); } public function testExistsNoToString() { $object = new CacheTestNoToSTring; $cache = new Cache; $this->setExpectedException('PHPUnit_Framework_Error'); $cache->exists($object); } public function testGetNoToString() { $object = new CacheTestNoToSTring; $cache = new Cache; $this->setExpectedException('PHPUnit_Framework_Error'); $cache->get($object); } public function testSetNoToString() { $object = new CacheTestNoToSTring; $cache = new Cache; $this->setExpectedException('PHPUnit_Framework_Error'); $cache->set($object, 'broken'); } } class CacheTestNoToSTring { } class CacheTestToSTring { public function __toString() { return 'any string'; } } __halt_compiler();----SIGNATURE:----jiY6TRjeNXgytCUT11yvXtEZebkviCGc5S9qlWDVQtDE6NrhPhdeSNbuQqBed3sk2d9KE5YjWpnjczZuH7+sossUvT61APz1GgiTP8HJPvuLX22BhNIhLTeNYiwfbEnfISx34+htDS7LvTHMK/7ZaafOwzAZREQo8gx8sJMU+SJSqplfH8XCOoWbBi97P8LB14noeusAxyABV/tQeJOZq59RqLZj82mSONEt9gAYif8HYRJqEbAtvKv7haliAXUz39rfD3At9uexmxTWzk3NkbCg3HoZ9N/h9jG133epR0sL+KPM+MVbFmPCOgoWnnp4MTHc18gPtpu0S2SDArdnjG4xWjTe6DJYUPorYhrDmUK/rQR+Om3MspP9+HkxQwYTtgSnF8enjzfwUUkHjY+E5EnIf2nm7DM4AGB6py26ZT2qtbjYaneAKNFBf1XQ21QwcR18meO+bdoEu77i/tNTeP0aJIAtWzMRoIJQN4vHK8m5cxynlzZtaExq/+sT3kfyZcSS4m1orpp4tPN62b5S6LY1gEDJrD1QGsQpL2wCWHJj3iT0K9Ft8MTNColPxlM5apUU1HcVvbqSfaHixf6RH7FyiBdcDQo5gTnc7FIrrq2Ujil1yBeIMivXw6OAkZNG77Iq5yPgEe788JFcZuonmOwOiHCZTVx+160k/3SIZ+M=----ATTACHMENT:----NzkwODQ2MjIyMjExOTA0IDg5OTEwNDQzNTAyMjc1MjAgMTM1MDM0OTc2MDEwNDgyMQ==