public function TestHttp::__construct in Migrate Plus 8.4
Same name and namespace in other branches
- 8.5 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 216 - 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_fetcherCode
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;
}