/** * @param array $expected * * @dataProvider indexActionDataProvider */ public function testIndexAction($expected) { $sampleData = $this->getMock('\\Magento\\Setup\\Model\\SampleData', [], [], '', false); $lists = $this->getMock('\\Magento\\Setup\\Model\\Lists', [], [], '', false); $controller = new CustomizeYourStore($lists, $sampleData); $sampleData->expects($this->once())->method('isDeployed')->willReturn($expected['isSampledataEnabled']); $lists->expects($this->once())->method('getTimezoneList')->willReturn($expected['timezone']); $lists->expects($this->once())->method('getCurrencyList')->willReturn($expected['currency']); $lists->expects($this->once())->method('getLocaleList')->willReturn($expected['language']); $viewModel = $controller->indexAction(); $this->assertInstanceOf('Zend\\View\\Model\\ViewModel', $viewModel); $this->assertTrue($viewModel->terminate()); $variables = $viewModel->getVariables(); $this->assertArrayHasKey('timezone', $variables); $this->assertArrayHasKey('currency', $variables); $this->assertArrayHasKey('language', $variables); $this->assertSame($expected, $variables); }
public function testDefaultTimeZoneAction() { $jsonModel = $this->controller->defaultTimeZoneAction(); $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel); $this->assertArrayHasKey('defaultTimeZone', $jsonModel->getVariables()); }