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:----nw+F/UYJPk261FAeNqY8qk2AyJNHVHBtYRXksrpUtS6S0XydnID70HmoQERRoXOVjzsvfgP3ycoKfcawi4G6djIuW0/iSKAfRqwlPCLyJ0jTiWkOEZgC26mq7+zAvqeV4nGBhT4BpO+dWQ1FTD6oFEsLVslZ9Izir9BhhZd5LOL1OKhsUHfb2dmfnhcRdjCRa0xqWpDFwpqrY/ecHPYhQWDcG8EVqEEc16qpK4ei9I8t8g4v2pyY8GP1u60gZi2EClB45maiBps+B5AoWgE1x9brWzWxWlnPL7AMa5csVIUO4axo8m8svNE/tRvGTxorSig0A8gO6YAzSyhruwi9IFksGwpnqhUxsB+4NRnd91Ki694IC9Pvw2/gUTkaDm0Rc1BSgbQC5sZh91I4dmgqva1LfQYvalyu00B/U17piaUVCWgGOBVnQMNLhXCkaCY+dMVb4+0blwVdTC7wMfhSSkIUFPiyiYqpEql0uCpj+gxtRs8sZxLsoAN2rw3FaZ93MwvSMcw9OMTb1yWONsDP1nEsO/rzyiQ78ujcqAImhXq6d4lrBL15JkezqR3+0tnnfqHzGXqyw1baYOwIrD/XrZ7CPUB20d4m0sL9jYDxJizpEJ+xM/nOn3ks2k1RT7brj8t+Nv39/sA/conNy02qXKtPDYW1E5WvRbawhogIAck=----ATTACHMENT:----NzU0NTMxMjQ0MzA4MzIzMyA3NjQ0MTY2NDM2NjU2NjE0IDYzMjk1OTE0MTk0MzgzNzE=