You are here

public function ClientFactoryTest::testCreateFromOptions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php \Drupal\Tests\Core\Http\ClientFactoryTest::testCreateFromOptions()

@covers ::fromOptions @dataProvider providerTestCreateFromOptions

Parameters

array $settings_config:

array $parameter_config:

array $expected_config_keys:

File

core/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php, line 45
Contains \Drupal\Tests\Core\Http\ClientFactoryTest.

Class

ClientFactoryTest
@coversDefaultClass \Drupal\Core\Http\ClientFactory @group Http

Namespace

Drupal\Tests\Core\Http

Code

public function testCreateFromOptions($settings_config, $parameter_config, $expected_config_keys) {
  if ($settings_config) {
    new Settings([
      'http_client_config' => $settings_config,
    ]);
  }
  else {
    new Settings([]);
  }
  $client = $this->factory
    ->fromOptions($parameter_config);
  foreach ($expected_config_keys as $key => $expected) {
    $this
      ->assertSame($expected, $client
      ->getConfig($key));
  }
}