Ejemplo n.º 1
0
 /**
  * @param array $items
  * @param array $expectedResult
  * @dataProvider checkServerDataProvider
  */
 public function testCheckServer($items, $expectedResult)
 {
     // 1. Create mocks
     /** @var \Magento\Install\Model\Installer\Data|\PHPUnit_Framework_MockObject_MockObject $installerData */
     list($this->model, $installerData) = $this->getMocks($items);
     // 2. Set expectations
     for ($i = 0; $i < count($items); $i++) {
         $text = $expectedResult[$i];
         $installerData->expects($this->at($i))->method('addError')->with($text);
     }
     // 3. Run tested method
     $this->model->checkServer();
 }