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:----eQDgeVAw1vkJVZp1UjUnsvRPXPLscouC9OCTIh7bccZR3Z8PoxdHvONePJBs6vFnhwG0n3VbPwhCTk5N2suQHT/IEgPYiIILocxSnakqVGfO7g1DowdhqND9yG4SvsIbNmmjQVTg5c6EiuroQaMGdt41vvd3wWwLoQdBynakGtwiXKktPz83gVufbRg1CYYpUdOhUtAfLchjdVdF9O6fURKQEG60WBs0bLLw/cTrYFcQ3Zyelz4yqr0mI/1ZAG0izOewNAWIWCaIeoH3Lv6woQ2A9M8RMlFxwRh7WhhvfdVDRzy70HvTkRBZMbk8G1hnyBdMJam83eS+RBV5rBy0YZ+o6hWhWeNjVXl+kHUs+YuvcHWtB5UGjSPfp5Bd4mWPts0h1N9eXF1QMQ51Bi1Lm0+lBxiAipsT+PLxWZ5AIWEkMWKilVLlOmZFqgSGD9mCIt67TZriXFloOP2yJXa0mw3579kpuB5yw/FMZCHe+C1GT9YsAxuhNWTdk+uCu2CueSCqsY+bNAlX1pFYzmBWCK7zWXAg5r4lLBc0d77hxboswa57gevr1k4ThUA9fhltplRsiULH073Ehy+n4AeLx5j/6vFdTf4/nWuBWbjrbMcoz59WB88Qo6OTB7/PQPEo4uUBm8KnV4Cl968iwFICavRCnL7dJzt3kHuYlKFDALY=----ATTACHMENT:----NDA4MDM1NDgxMjA0OTg1MSAxODk4MTcxMDkwMTAyMjczIDg2MTIxMDA5NjcwMDQwOTk=