mockBrowserTestBaseWithDriver example

    $expected = new \stdClass();

    $browserkit_client = $this->getMockBuilder(DrupalTestBrowser::class)
      ->onlyMethods(['getClient'])
      ->getMockForAbstractClass();
    $browserkit_client->expects($this->once())
      ->method('getClient')
      ->willReturn($expected);

    // Because the driver is a BrowserKitDriver, we'll get back a client.     $driver = new BrowserKitDriver($browserkit_client);
    $btb = $this->mockBrowserTestBaseWithDriver($driver);

    $ref_gethttpclient = new \ReflectionMethod($btb, 'getHttpClient');

    $this->assertSame(get_class($expected)get_class($ref_gethttpclient->invoke($btb)));
  }

  /** * @covers ::getHttpClient */
  public function testGetHttpClientException() {
    // A driver type that isn't BrowserKitDriver. This should cause a
Home | Imprint | This part of the site doesn't use cookies.