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:----Pa36IFOy1LwuCtFzgEtxmpMbhUUq0RncPX1vAYMgtlmn4MxY8b/ycsYyHs7zGeS9KqEgioih9W1YJjkWgYoLEsmgJpQ7xEvYD9FJSNxPVtGOOwN+u+dBzst55nCT5gY9Rw+RjbZz/VbSTnPMYIz3rLjYuQPmueWnLsgnIFjbyTn12l13NSXGPvX5Og0xzoY6rgDA5yzSD9FUevpZgXgFnfdSrDCew2a6Cu3cEDeljeK4i0uKplghhQ9Y5apHeV3tdP0374I2w94tMzcHRG5lfsGImPdNWhFRs79joTgfjtJ0CuFKTtPVwBZNGD61AJA4ZcMX0x+hXzHGqyS7FWcAn0PuvQ6RLuXmLJ05yvLSNcK2y6IjNwmNGHNl5lrFor5YAVdJvE45iESHKcocdU0IszkH5sqgxi6o6Psrgy7MT+b2PmKUrRNvQF4wsflfeOCu+1zK8etV6CGskbkyKHSzztxgnLX4X5F9tEbPyVDxOvsFlEJTdIO6+aatW/lR6AComGxaPoWpg14GTdz9JEKHidnrsf1C6CV3xwozP47rRHb8GuVbqQxVeAUwlQeRL1FCyDNKS4zm9D+lmCgj6VmRLWZWBZEIsw8xdhNKCc1Tih1Rg1r5+T9RyMPBp5QoybcRIW6B8cYFCsz1Wbu7doXjdhOSENDmmDPK6X4Hut/wuMQ=----ATTACHMENT:----MTU1NzI1OTI1MDYxNTg3MCA2ODIyNDAwMDUxOTcyOTIzIDMzNzk5Mzc4NzA3MjMzMzM=