Example #1
0
 public function testGetData()
 {
     $this->object->setValue('key1', 'value1', 'default1');
     $this->object->setValue('key2', 'value2', 'default2');
     $this->object->setValue('key3', 'value3', 'value3');
     $this->object->unsValue('key1');
     $this->assertEquals(['key2' => 'value2'], $this->object->getData());
 }
 /**
  * Returns Indicate2 context ID from intern context ID
  *
  * @param int $contextId Context ID (intern)
  *
  * @return int
  * @throws Indicate2_Exception
  */
 public function getIndicate2ContextId($contextId)
 {
     try {
         $contextPrefix = getContextPrefix();
         $contextModel = new Context();
         // data exists?
         if ($contextData = $contextModel->getData($contextId)) {
             //Zend_Debug::dump($contextData);
             // data found, get context id from indicate2
             return $this->createHeader($contextData);
         } else {
             // no data found
             throw new Exception("Keine Kontext-Daten zur ID " . $contextId . " vorhanden.");
         }
     } catch (Exception $e) {
         throw new Indicate2_Exception($e->getMessage());
     }
 }
Example #3
0
 public function testSetGetData()
 {
     $this->object->setData('foo', 'bar');
     $this->assertEquals($this->object->getData('foo'), 'bar');
 }