You are here

public function TestHttp::__construct in Migrate Plus 8.5

Same name and namespace in other branches
  1. 8.4 tests/src/Unit/data_fetcher/HttpTest.php \Drupal\Tests\migrate_plus\Unit\data_fetcher\TestHttp::__construct()

Constructs a \Drupal\Component\Plugin\PluginBase object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Overrides Http::__construct

File

tests/src/Unit/data_fetcher/HttpTest.php, line 218
PHPUnit tests for the Migrate Plus Http 'data fetcher' plugin.

Class

TestHttp
Test class to mock an HTTP request.

Namespace

Drupal\Tests\migrate_plus\Unit\data_fetcher

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition) {

  // Skip calling the Http() constructor (that sets the httpClient instance
  // variable via \Drupal which we don't want to do), but keep the call to its
  // parent class constructor. @see https://bugs.php.net/bug.php?id=42016
  DataFetcherPluginBase::__construct($configuration, $plugin_id, $plugin_definition);

  // This is what the parent class is doing, that we need to override.
  $this->httpClient = NULL;
}