public function BrowserTestBaseTest::testGetHttpClientException in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php \Drupal\Tests\Core\Test\BrowserTestBaseTest::testGetHttpClientException()
- 9 core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php \Drupal\Tests\Core\Test\BrowserTestBaseTest::testGetHttpClientException()
@covers ::getHttpClient
File
- core/tests/ Drupal/ Tests/ Core/ Test/ BrowserTestBaseTest.php, line 64 
Class
- BrowserTestBaseTest
- @coversDefaultClass \Drupal\Tests\BrowserTestBase @group Test
Namespace
Drupal\Tests\Core\TestCode
public function testGetHttpClientException() {
  // A driver type that isn't BrowserKitDriver. This should cause a
  // RuntimeException.
  $btb = $this
    ->mockBrowserTestBaseWithDriver(new \stdClass());
  $ref_gethttpclient = new \ReflectionMethod($btb, 'getHttpClient');
  $ref_gethttpclient
    ->setAccessible(TRUE);
  $this
    ->expectException(\RuntimeException::class);
  $this
    ->expectExceptionMessage('The Mink client type stdClass does not support getHttpClient().');
  $ref_gethttpclient
    ->invoke($btb);
}