Example #1
0
 public function testStoreData()
 {
     $memcacheObject = $this->getMock('StdClass', ['set', 'get', 'getResultCode']);
     $memcacheObject->expects($this->once())->method('set')->with($this->equalTo('foo'))->will($this->returnValue('Foo Bar'));
     $memcacheObject->expects($this->once())->method('get')->with($this->equalTo('foo'))->will($this->returnValue('Foo Bar'));
     $memcacheObject->expects($this->once())->method('getResultCode')->will($this->returnValue(0));
     $m = new \Cygnite\Cache\Storage\Memcached($memcacheObject);
     $m->store('foo', 'Foo Bar');
     $this->assertEquals('Foo Bar', $m->get('foo'));
 }