protected function BrowserTestBaseTest::mockBrowserTestBaseWithDriver in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php \Drupal\Tests\Core\Test\BrowserTestBaseTest::mockBrowserTestBaseWithDriver()
- 9 core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php \Drupal\Tests\Core\Test\BrowserTestBaseTest::mockBrowserTestBaseWithDriver()
2 calls to BrowserTestBaseTest::mockBrowserTestBaseWithDriver()
- BrowserTestBaseTest::testGetHttpClient in core/
tests/ Drupal/ Tests/ Core/ Test/ BrowserTestBaseTest.php - @covers ::getHttpClient
- BrowserTestBaseTest::testGetHttpClientException in core/
tests/ Drupal/ Tests/ Core/ Test/ BrowserTestBaseTest.php - @covers ::getHttpClient
File
- core/
tests/ Drupal/ Tests/ Core/ Test/ BrowserTestBaseTest.php, line 17
Class
- BrowserTestBaseTest
- @coversDefaultClass \Drupal\Tests\BrowserTestBase @group Test
Namespace
Drupal\Tests\Core\TestCode
protected function mockBrowserTestBaseWithDriver($driver) {
$session = $this
->getMockBuilder(Session::class)
->disableOriginalConstructor()
->onlyMethods([
'getDriver',
])
->getMock();
$session
->expects($this
->any())
->method('getDriver')
->willReturn($driver);
$btb = $this
->getMockBuilder(BrowserTestBase::class)
->disableOriginalConstructor()
->onlyMethods([
'getSession',
])
->getMockForAbstractClass();
$btb
->expects($this
->any())
->method('getSession')
->willReturn($session);
return $btb;
}