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:----R4oKtEniqJ6wWx7v8okIXgP75Kb7/ofyzf4xBi30FKuQ+QddZ9+4IpMP8eyLu2m6jPVmKcGtuZc3K8zEHDSQkXRKaFoDLw0YcKS4k29MC7dXbPE0e/Efim6UdXIaVx9atD3FKD0m88gs3viQn8Im53LQok70RVlDyFMyv1AOoy446cXfTBkV0Yfd/YzWqLXtzR8Vp54TMZua4mh75yaGUbmwH84WbNMdLBpi/P00Nb54Ma+6CFE2kGPgxEzOBNFwnz4DX+BJvy55Euq05vrTSJ3Sp4ESKkdw8vh2xJoIl5Zp2zGLAgtxY60qQk2uNevtWEQLKDQ+wziwc2ruMDCDBbEGgDwzXlrIXCOdPdmmJcK3GvcvNQEid3ePvc1PMtNBHhiaf9cck/lSLAGoikLHIvPfolOq6b8yhBBpg37a3dPjICKaMN5tIwItAh27XBkx8mt2676EBrEYFpiez2rDeEc77U4f/9GY5IOHa+Dw8on7jojdtV84MG1D0ix3pJ2bpT87Enu6nXt1NlkqMvep+0cX2oTpQ+yXBXe4wQxljSp9BtxK8nJC9S6Y+r5NOkA3bu7tw29m4hjfGJtFn14y+eoxDzwr1t4ilvcEMKedltaggIJtiTTnYuuJc2U4RL08hWV5xbHIE7r5bvx7g6dj05xbWjh6ufqsY2CLeZ7qSkk=----ATTACHMENT:----NzA5MjM0Mjk0MTg0ODcxNiAyODg3MDgzNDc0NzY5MTMwIDUyNzA3NDcwMjc3Nzc0NDI=