3 namespace Drupal\Tests\migrate_plus\Kernel\Plugin\migrate_plus\data_fetcher;
5 use Drupal\KernelTests\KernelTestBase;
6 use Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher\Http;
12 * @package Drupal\Tests\migrate_plus\Unit\migrate_plus\data_fetcher
14 class HttpTest extends KernelTestBase {
17 * Test http headers option.
19 * @dataProvider headerDataProvider
21 public function testHttpHeaders(array $definition, array $expected, array $preSeed = []) {
22 $http = new Http($definition, 'http', []);
23 $this->assertEquals($expected, $http->getRequestHeaders());
27 * Provides multiple test cases for the testHttpHeaders method.
32 public function headerDataProvider() {
34 'dummy headers specified' => [
37 'Accept' => 'application/json',
38 'User-Agent' => 'Internet Explorer 6',
39 'Authorization-Key' => 'secret',
40 'Arbitrary-Header' => 'foobarbaz',
44 'Accept' => 'application/json',
45 'User-Agent' => 'Internet Explorer 6',
46 'Authorization-Key' => 'secret',
47 'Arbitrary-Header' => 'foobarbaz',
50 'no headers specified' => [
52 'no_headers_here' => 'foo',