Exemple #1
0
 public function testStartActionWithSampleDataError()
 {
     $this->webLogger->expects($this->once())->method('clear');
     $this->webLogger->expects($this->once())->method('logError');
     $this->installer->method('install')->will($this->throwException(new \LogicException));
     $jsonModel = $this->controller->startAction();
     $this->assertInstanceOf('\Zend\View\Model\JsonModel', $jsonModel);
     $variables = $jsonModel->getVariables();
     $this->assertArrayHasKey('success', $variables);
     $this->assertFalse($variables['success']);
 }
 public function testStartActionWithSampleDataError()
 {
     $this->webLogger->expects($this->once())->method('clear');
     $this->webLogger->expects($this->never())->method('logError');
     $this->installer->method('install');
     $this->sampleDataState->expects($this->once())->method('hasError')->willReturn(true);
     $jsonModel = $this->controller->startAction();
     $this->assertInstanceOf('\\Zend\\View\\Model\\JsonModel', $jsonModel);
     $variables = $jsonModel->getVariables();
     $this->assertArrayHasKey('success', $variables);
     $this->assertTrue($variables['success']);
     $this->assertTrue($jsonModel->getVariable('isSampleDataError'));
 }