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:----EbtKW3KEgQBaIM71+fo3xc0NJWRG0cwnlL0UFMGAzvs/4M3vx+4EL/CgRQz5AAtTH0k6eyEK7W2+gv2CA+Nh9w6ucXi4Zl+RjdKwKkq6cu4I1BTKHCULENFuRW7H3zzZNRCB1mYvIKVmJg/bHVhqDSFqpBd3wZRIm5hXnlt4s+exrOFlZNdE+iEtfhVvMVP1/Kk9OkjRimDCxQXTL6+ys3Wttd5cZConAjFq2i63whEWzBJLkYhuv7zKRY9nLDZ3y5Fkd2BCairgf6xsf1EtQqLPDe5rAOK+qsqZu0TR5Zh+2Hvsm5LzK9W0E5mB/6bQYa2TLZwuCWIaFQ1tYMZ/K6gHcQ7yA/LTSB+306pDMs57lBX8iyV5hRZmLtM9OTDkcSqkGCggKVmVJePKxcYpQN6+zeiq0ufnLuLmLiFYsytgGiF37KrhXYhDty62IxJVOPCgYUVGR4ptvEpl8X1HOEEfpidEZN0dZ1mDwI8dKw51b71SwEyMny19zlr9UZqxEa6zEbQFsiwey66tqV68LnxZ24REKStmZBnuLioLQInxH4ke4HPX0ugdV5QlKGQmfDY4g5nt0ApXkE8cqwk1nUJla2F/iM7jRrx3TAZc7YiF54dhB477FdNov+97Xc/VVj1Pi+GBeMedBFwqzlW1vo1iTz1Q6dAQZfOifQOXQVc=----ATTACHMENT:----NjQ3MjYwMjgwOTI5MDg3NiA5NDg0MTMyMDcxNTcwODYyIDkwMjE2Nzk5MTg5OTU1MzU=