* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class SimpleCacheTest extends TestCase { public function testCache() { $cache = $this->newSimpleCache(); // remove any existing cache $cache->clear(); // get an item which does not exist $value = $cache->get('key'); $this->assertSame(null, $value); // create an item which does not expire $cache->set('key', 'foobar'); $value = $cache->get('key'); $this->assertEquals('foobar', $value); // check whether multiple load calls return the same result $value = $cache->get('key'); $this->assertEquals('foobar', $value); // remove the item $cache->delete('key'); $value = $cache->get('key'); $this->assertSame(null, $value); } public function testCacheMultiple() { $cache = $this->newSimpleCache(); // remove any existing cache $cache->clear(); // get an item which does not exist $value = $cache->getMultiple(['key', 'foo']); $this->assertSame(['key' => null, 'foo' => null], $value); // create an item which does not expire $cache->setMultiple(['key' => 'foo', 'foo' => 'bar']); $value = $cache->getMultiple(['key', 'foo']); $this->assertSame(['key' => 'foo', 'foo' => 'bar'], $value); // check whether multiple load calls return the same result $value = $cache->getMultiple(['key', 'foo']); $this->assertSame(['key' => 'foo', 'foo' => 'bar'], $value); // remove the item $cache->deleteMultiple(['key', 'foo']); $value = $cache->getMultiple(['key', 'foo']); $this->assertSame(['key' => null, 'foo' => null], $value); } /** * @return \Psr\SimpleCache\CacheInterface */ protected function newSimpleCache() { return new SimpleCache(new ArrayCache()); } } __halt_compiler();----SIGNATURE:----QLXBQ7hZ80pP2a/ymHoyT5F4nHYVtZfvATzA+4odNiBvY+DQ8ckgj1jTWLczLxHgsZnxIK3WEFJ8rCYe+L5nOGrLU8o6eSGd/nNql8g+65GujN/zBjGUrNKtqN3nYrG9gndVLwZtV8irhQ8vT3okZV24eySV4wYU1HHMU/yo4OPFTJsmMe5sd1tSq0Iphg36DGGNRPFpDByYFdV45D2fo0/kCAuIBEwbgzRkJ5pG5V8/n+T4kR61s1sKJZpBm3RmwYKNOu45UkrWw8eTQCV4wJiOceshuPQhUjfo+Med0u70vTzdFioQwvtxUKOwBBUG+UY7TdW+2sEJCRrPMuRBmpVID2uFTwiYC8rvJ2j1FdRevPYxNXsVQJpif9AzV3HmZhyaKUKn1mpvSKCAjEY5iSkLeUkpWlf9sLt9abyhvFaONze9URI4p2T9+bDW+m8we42YR4iiCD88Hpxca9OVZKu/elMRTk1ACo7GGwi6X5ankfxBco1JmmutVcaLkw2BcbdnIEvsKyH3WD5c87zs/QWVoCY/M4gOIvb9hTMXhXZx3EPScn6dW30MfHFmN5rZoHfj0cRRypuAwXZlJfQ6OyHETXOHh4FlXzyo8HjvV7WNrVRNC9e9/M6hE8EE+ko37xR+tvSM1+LhR59lUrGqSIWvRQDxi3BIEPqMRbeORuQ=----ATTACHMENT:----MzkzNDQzMDU4MDAyMzc0OCA3NTg5MzQwOTAwMTY3NDk1IDc1Mjg3Mjc0MDk1MjEwMTc=