Example #1
0
 /**
  * Test the index controller with Layout Template override
  *
  * @return null
  * @covers Rcm\Controller\IndexController
  */
 public function testIndexActionWithLayoutOverride()
 {
     $this->layoutOverride = 'newLayout';
     $this->pageData = $this->getPageData(42, 'my-test', 443, 'z', false, $this->layoutOverride);
     $this->routeMatch->setParam('action', 'index');
     $this->routeMatch->setParam('page', 'my-test');
     $this->routeMatch->setParam('pageType', 'z');
     $this->routeMatch->setParam('revision', 443);
     $this->mockUserServicePlugin->expects($this->any())->method('__invoke')->will($this->returnValue(true));
     $this->mockShouldShowRevisions->expects($this->any())->method('__invoke')->will($this->returnValue(true));
     $this->mockIsPageAllowed->expects($this->any())->method('__invoke')->will($this->returnValue(true));
     $result = $this->controller->dispatch($this->request);
     /** @var \Zend\Http\Response $response */
     $response = $this->controller->getResponse();
     $this->assertEquals(200, $response->getStatusCode());
     $this->assertEquals('my-test', $this->controller->pageName);
     $this->assertEquals('z', $this->controller->pageType);
     $this->assertEquals(443, $this->controller->pageRevisionId);
     $this->assertEquals('layout/' . $this->layoutOverride, $this->controller->layout()->getTemplate());
 }