/**
  * @return JsonModel
  */
 public function indexAction()
 {
     $json = new JsonModel();
     $json->setVariable('nav', $this->navigation->getData());
     $json->setVariable('menu', $this->navigation->getMenuItems());
     $json->setVariable('main', $this->navigation->getMainItems());
     $json->setVariable('titles', $this->navigation->getTitles());
     return $json;
 }
Example #2
0
 /**
  * @return JsonModel
  */
 public function indexAction()
 {
     return $this->jsonModel->setVariable('nav', $this->navigation->getData());
 }
 public function testGetData()
 {
     $this->assertEquals([['key1' => 'value1'], ['key2' => 'value2'], ['nav' => 'abc', 'key3' => 'value3'], ['nav' => ''], ['nav' => false], ['main' => 'abc', 'key3' => 'value3'], ['main' => ''], ['main' => false]], $this->navigation->getData());
 }
Example #4
0
 /**
  * @return JsonModel
  */
 public function indexAction()
 {
     $json = new JsonModel();
     return $json->setVariable('nav', $this->navigation->getData());
 }
 public function testGetData()
 {
     $this->serviceLocatorMock->expects($this->once())->method('get')->with('config')->will($this->returnValue(['nav' => [['key1' => 'value1'], ['key2' => 'value2']]]));
     $this->assertEquals([['key1' => 'value1'], ['key2' => 'value2']], $this->navigation->getData());
 }