Example #1
0
 public function testConstructionOptions()
 {
     $key = array('apple', 'sauce');
     $options = array();
     $options['servers'][] = array('127.0.0.1', '11211', '50');
     $options['servers'][] = array('127.0.0.1', '11211');
     $options['extension'] = $this->extension;
     $driver = new ehough_stash_driver_Memcache();
     $driver->setOptions($options);
     $item = new ehough_stash_Item();
     $poolStub = new ehough_stash_test_stub_PoolGetDriverStub();
     $poolStub->setDriver($driver);
     $item->setPool($poolStub);
     $item->setKey($key);
     $this->assertTrue($item->set($key), 'Able to load and store memcache driver using multiple servers');
     $options = array();
     $options['extension'] = $this->extension;
     $driver = new ehough_stash_driver_Memcache();
     $driver->setOptions($options);
     $item = new ehough_stash_Item();
     $poolStub = new ehough_stash_test_stub_PoolGetDriverStub();
     $poolStub->setDriver($driver);
     $item->setPool($poolStub);
     $item->setKey($key);
     $this->assertTrue($item->set($key), 'Able to load and store memcache driver using default server');
 }
Example #2
0
 public function testConstruction()
 {
     $key = array('apple', 'sauce');
     $options = array();
     $options['servers'][] = array('127.0.0.1', '11211', '50');
     $driver = new ehough_stash_driver_Memcache();
     $driver->setOptions($options);
     $item = new ehough_stash_Item();
     $poolStub = new ehough_stash_test_stub_PoolGetDriverStub();
     $poolStub->setDriver($driver);
     $item->setPool($poolStub);
     $item->setKey($key);
     $this->assertTrue($item->set($key), 'Able to load and store with unconfigured extension.');
 }