/**
  * @return void
  */
 public function testCreateGetHasElement()
 {
     $data = [uniqid() => uniqid()];
     $elementId = uniqid('id');
     $this->assertFalse($this->_structure->hasElement($elementId));
     $this->assertFalse($this->_structure->getElement($elementId));
     $this->_structure->createElement($elementId, $data);
     $this->assertTrue($this->_structure->hasElement($elementId));
     $this->assertSame($data, $this->_structure->getElement($elementId));
 }
Example #2
0
 /**
  * Checks if element with specified name is container
  *
  * @param string $name
  * @return bool
  */
 public function isContainer($name)
 {
     if ($this->_structure->hasElement($name)) {
         return Element::TYPE_CONTAINER === $this->_structure->getAttribute($name, 'type');
     }
     return false;
 }