Пример #1
0
 public function testIndexAction()
 {
     /** @var $controller Index */
     $controller = new Index();
     $viewModel = $controller->indexAction();
     $this->assertInstanceOf('Zend\\View\\Model\\ViewModel', $viewModel);
     $this->assertFalse($viewModel->terminate());
 }
Пример #2
0
 public function testIndexAction()
 {
     $this->objectManager = $this->getMockForAbstractClass('Magento\\Framework\\ObjectManagerInterface');
     $this->objectManagerProvider = $this->getMock('Magento\\Setup\\Model\\ObjectManagerProvider', ['get'], [], '', false);
     $this->deploymentConfig = $this->getMock('Magento\\Framework\\App\\DeploymentConfig', [], [], '', false);
     $this->objectManagerProvider->expects($this->once())->method('get')->willReturn($this->objectManager);
     $this->objectManager->expects($this->once())->method('get')->willReturn($this->deploymentConfig);
     $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
     /** @var $controller Index */
     $controller = new Index($this->objectManagerProvider);
     $viewModel = $controller->indexAction();
     $this->assertInstanceOf('Zend\\View\\Model\\ViewModel', $viewModel);
     $this->assertFalse($viewModel->terminate());
 }
Пример #3
0
 public function testIndexActionNotInstalled()
 {
     $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
     $this->objectManagerProvider->expects($this->exactly(0))->method('get');
     /** @var $controller Index */
     $controller = new Index($this->objectManagerProvider, $this->deploymentConfig);
     $viewModel = $controller->indexAction();
     $this->assertInstanceOf('Zend\View\Model\ViewModel', $viewModel);
     $this->assertFalse($viewModel->terminate());
 }