public function testCreateGetHasElement() { $data = array(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)); }
/** * Checks if element with specified name is container * * @param string $name * @return bool */ public function isContainer($name) { if ($this->_structure->hasElement($name)) { return self::TYPE_CONTAINER === $this->_structure->getAttribute($name, 'type'); } return false; }