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:----VDHlOEIZym5fBtUG5kHVCBgHIXOiE03WnPBBNZbTTFNvrTJpVD7J5Ka0Agloy/OIqxraiS9a5Zb7pZ8eY8wnFnusvHuhHjbhP7Nq51r1Ipksw5eE7nKV8V+12XLKVuwaOIWTCYfHdjiDr14sSvX30iGQYO4UdcInLhoTVY8uzJEZYzXIFtCVIgDK5hhLfr3idSl4n5QcuiRCrcutU1w+6zDIp/j3Jg9QP4eYST/fMaJqDQwts8DgeUbuFVJkTj1V3LTy7kxylSyqTZNphZI/wuP63VXHeahGi+oKMSWzVzA7/bsTT1bPMzwTUIS30EVvZTuDC1K3RUKL4yjXHhe0Gj9+5PKXUxVqUddif61y6Z47JTHim6rrkIHej1yugumJm4/uM588DN6zShJcC1pAZQsl8zGVe/ohGfdg14EK5ELpyZ0c/oX8dZv6Wco0VItl55MHObCAy1Nb5hU4GYxDhflQmJu32hLAlV3IybFwR0aYhKNDMSZbm//dS9JNdmqWx3IDl2B8pq8FlS1HL0srgd2Yv1WFjWYsSkjgL/fB0jEo6C0L9doXprn2CQ5szK9V9wodDLf+pBODKJ4U3YXxyvN8cdgLneAWh+Lr80CETNdriNFVAMv/VbnIEA9L/5bZbTSXfZG1KYa9hnq4jHq01RfDAoTKG2b7fdPlkY0oSUY=----ATTACHMENT:----Mjg1NjAzMDI3ODUwNDI4NiA3NDE3MzQ4ODY4Njk5NDQ1IDEwNzQ1MzAwNTAxNTA3MTQ=