Exemplo n.º 1
0
 public function testIndexAction()
 {
     /** @var $controller Success */
     $controller = new Success();
     $viewModel = $controller->indexAction();
     $this->assertInstanceOf('Zend\\View\\Model\\ViewModel', $viewModel);
     $this->assertTrue($viewModel->terminate());
 }
Exemplo n.º 2
0
 public function testIndexAction()
 {
     $moduleList = $this->getMock('Magento\\Framework\\Module\\ModuleList', [], [], '', false);
     $moduleList->expects($this->once())->method('has')->willReturn(true);
     $objectManagerProvider = $this->getMock('Magento\\Setup\\Model\\ObjectManagerProvider', [], [], '', false);
     $objectManager = $this->getMock('Magento\\Framework\\App\\ObjectManager', [], [], '', false);
     $objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager);
     $sampleDataState = $this->getMock('Magento\\Framework\\Setup\\SampleData\\State', ['hasError'], [], '', false);
     $objectManager->expects($this->once())->method('get')->willReturn($sampleDataState);
     /** @var $controller Success */
     $controller = new Success($moduleList, $objectManagerProvider);
     $sampleDataState->expects($this->once())->method('hasError');
     $viewModel = $controller->indexAction();
     $this->assertInstanceOf('Zend\\View\\Model\\ViewModel', $viewModel);
     $this->assertTrue($viewModel->terminate());
 }