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:----Hx9XgAvW+ngO3ho2eugv4qPgawFCEwN/HK2eLGuzwOpH0qxm+JySMRe3UyAsSFWHHuJHvRKCSL0zM4qisGcAhgkhjsI4vSuQANw1WlS69RxzZpBZ4h+tuNM7c2ZMQnj0B339IPFIOm/dQJCHhH34/fBR1MFRbGTMgAzJuuTGbNeyQHPnFxZ3fcL5z5WN4/i6bN12Z0x3DmXU3Oi71AK1dpqdCH+H03oQZqmSINi63cu7a2ciu+WQTg3HctQZZ9ICStKSUxHliJ1Ma3075qM19jUkiRY/Beswkn+e/lR7NTCL56VeSaB9WpI4CeXy/7YKFPczwxR34Tugd+2M7+5ZxYuNwtSsCWTvKUejM2ReNfzvNfEUj7rnMuSA9CHCdm69exFJFPD7vxVY1LjvuWqyWZF93QXcsudKcRSu4PpHNANaJy4kETyMNLaW8JbG1f/NULKaNahmZnn5nMv1693Mbo9t4wzliBplLAiLjEYE0BMWifiyB2cNVGuOT8ByW3BMoqD2xJGvM3r7MBS4cG8+ZIT1EyAmsVGMY9D5jIhfg4O4Mh68UAQrHnOyMBrRzTeKYhuQwyayXhNuBbOQ8TCYBpqkI61aS5k2aohCEIWuaYQwtkTUZfUTsyqlunlSmFNgB9mG2NgkwoABCLHfmq8hcs32EhRXvJN9Oaz8+g7eBE0=----ATTACHMENT:----NTk0NTY5NjY3ODY1NTc0OCAzNDYzNzMyMTQ4NzQ0OTIxIDQ5ODQ2NjA4MTY5NjY0NzY=