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:----nUBZ/cNBZ6KdcqP3eU1oee2pcyrChWEB+xDlxxy6Sf0Qr0vocD61V7UEUfuDDtzFakx4/YaGlM7kVwy4X5UQOrd5DgnrUYNHRsNMJh7W14ssa29ZRoSlycyoKn7zDbps95AigpKgG84P5txlGtuOLZstaRKvv2J5mOwiGLOvwfFEJZc+KENs0id6GnelHglOzI/jGjb0fbf7mnSxAx/Dtc379wC/1e0yH685Au6zkXR4iaKkCMv18MTspPsQ/M58vhBqvN8NbmU39JUbmBSXHl2rU0fCaphCI3plZSA5yYjg8d0vidjCWI7Z5QB79qc1NP0OJTdE3hq7mN6eodIeEnhG4C57knQVADK4y8PD/J+xEedkxLYeMA1Gw0QdoCeut0pQXBbLwWSROM6aidMuahhubRB2TgTfwTBqqXzMxhtiUXpLFGiJV2jmKQGxYOd19r5lDSuRwJZwi+cXTUrHA7wPfypSwNE1T5Kwj7A20MFdvTAYQ/J/YspUB0BEbpnlRFBzOPhpoyeKSzKD0zob7wzUfDg9N+euMFk9Grq36LYw/aBPSvGaC7LwqIRvXcWZF4FUKFXobI0O/GOE1yGC0eEJKYJ7cW6du9nOUFgXgRdjCs8Mra+WD7ZgesGcNRoA29iOGkUqo5XI9DRqeNUvF8eujcLdi+OhrcvelpQWK7k=----ATTACHMENT:----MTE1Njc5NjM4NzI3NzYyNyA4MDE3OTM4MzEyMzY4OTM1IDUwMjA3MjA3Nzk4OTM5MDY=