/**
  * @param string $hosts
  * @param bool $expectedError
  * @dataProvider validateCacheHostsDataProvider
  */
 public function testValidateCacheHosts($hosts, $expectedError)
 {
     $options = [ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => true, ConfigOptionsListConstants::INPUT_KEY_CACHE_HOSTS => $hosts];
     $result = $this->object->validate($options, $this->deploymentConfig);
     if ($expectedError) {
         $this->assertCount(1, $result);
         $this->assertEquals("Invalid http cache hosts '{$hosts}'", $result[0]);
     } else {
         $this->assertCount(0, $result);
     }
 }
Пример #2
0
 public function testCreateOptionsWithOptionalNull()
 {
     $configDataMock = $this->getMock('Magento\\Framework\\Config\\Data\\ConfigData', [], [], '', false);
     $this->generator->expects($this->once())->method('createInstallConfig')->willReturn($configDataMock);
     $this->generator->expects($this->once())->method('createCryptConfig')->willReturn($configDataMock);
     $this->generator->expects($this->once())->method('createSessionConfig')->willReturn($configDataMock);
     $this->generator->expects($this->once())->method('createDefinitionsConfig')->willReturn(null);
     $this->generator->expects($this->once())->method('createDbConfig')->willReturn($configDataMock);
     $this->generator->expects($this->once())->method('createResourceConfig')->willReturn($configDataMock);
     $configData = $this->object->createConfig([], $this->deploymentConfig);
     $this->assertEquals(5, count($configData));
 }