Exemplo n.º 1
0
 /**
  * Test the whole transport
  */
 public function testAll()
 {
     $sTestVal = uniqid();
     $sTestKey = (int) microtime(true);
     $sTestTestKey = md5($sTestKey);
     $this->assertFalse($this->_object->read($sTestKey));
     $this->assertInstanceOf($this->_sTestClass, $this->_object->write($sTestKey, $sTestVal));
     $this->assertInstanceOf($this->_sTestClass, $this->_object->write($sTestTestKey, $sTestVal));
     $this->assertEquals($sTestVal, $this->_object->read($sTestKey));
     $this->assertInstanceOf($this->_sTestClass, $this->_object->delete($sTestKey));
     $this->assertFalse($this->_object->read($sTestKey));
     $this->assertEquals($sTestVal, $this->_object->read($sTestTestKey));
     $this->assertInstanceOf($this->_sTestClass, $this->_object->free());
     $this->assertFalse($this->_object->read($sTestTestKey));
 }
Exemplo n.º 2
0
 /**
  * Read the test-results from shared-memory
  *
  * @return $this
  */
 private function _read()
 {
     foreach (array_keys($this->_aStack) as $iStack) {
         $mResult = $this->_oTransport->read($iStack);
         if (empty($mResult) !== true) {
             $this->_aStack[$iStack] = unserialize(gzuncompress($mResult));
             $this->_oTransport->delete($iStack);
         }
     }
     return $this;
 }