public function setData($key, $value = null)
{
if (is_array($key)) {
$this->data = array_merge($this->data, $key);
} else {
$this->data[$key] = $value;
}
}
public function testSetDataWithArray() { $item = new \ElggMenuItem('name', 'text', 'url'); $item->setData(array('priority' => 88, 'new' => 64)); $this->assertEquals(88, $item->getData('priority')); $this->assertEquals(88, $item->getPriority()); $this->assertEquals(64, $item->getData('new')); }