Ejemplo n.º 1
0
 public function testPrefixesSupported()
 {
     $key = 'test';
     $fixtureA = 'Hello';
     $fixtureB = 'World!';
     $configA = $this->config;
     $configA['prefix'] = 'a';
     $configB = $this->config;
     $configB['prefix'] = 'b';
     //
     Configure::write(Memcache::ConfigurePath, $configA);
     $instance = new Memcache();
     $instance->set($key, $fixtureA);
     Configure::write(Memcache::ConfigurePath, $configB);
     $instance = new Memcache();
     $instance->set($key, $fixtureB);
     //
     Configure::write(Memcache::ConfigurePath, $configA);
     $instance = new Memcache();
     $this->assertEquals($instance->get($key), $fixtureA);
     //
     Configure::write(Memcache::ConfigurePath, $configB);
     $instance = new Memcache();
     $this->assertEquals($instance->get($key), $fixtureB);
     $this->AssertTrue($instance->isActual($key));
     $instance->clear($key);
     $this->AssertFalse($instance->isActual($key));
     Configure::write(Memcache::ConfigurePath, $configA);
     $instance = new Memcache();
     $this->assertEquals($instance->get($key), $fixtureA);
     $this->AssertTrue($instance->isActual($key));
     $instance->clear($key);
     $this->AssertFalse($instance->isActual($key));
 }