protected function SimpleFbConnectPostLoginManagerTest::generateStubUrl in Simple FB Connect 8.3
Same name and namespace in other branches
- 8.2 tests/src/Unit/SimpleFbConnectPostLoginManagerTest.php \Drupal\Tests\simple_fb_connect\Unit\SimpleFbConnectPostLoginManagerTest::generateStubUrl()
Helper function to generate stub Url objects.
Parameters
bool $external: Value to be returned from 'isExternal' method.
string $path: Value to be returned from 'toString' method.
3 calls to SimpleFbConnectPostLoginManagerTest::generateStubUrl()
- SimpleFbConnectPostLoginManagerTest::testGetPostLoginPathWithInvalidQueryParameter in tests/
src/ Unit/ SimpleFbConnectPostLoginManagerTest.php - Tests getPostLoginPath method with invalid query parameter.
- SimpleFbConnectPostLoginManagerTest::testGetPostLoginPathWithValidQueryParameter in tests/
src/ Unit/ SimpleFbConnectPostLoginManagerTest.php - Tests getPostLoginPath method with valid query parameter.
- SimpleFbConnectPostLoginManagerTest::testPostLoginPathWithInvalidModulePath in tests/
src/ Unit/ SimpleFbConnectPostLoginManagerTest.php - Tests getPostLoginPath method with fallback to 'user'.
File
- tests/
src/ Unit/ SimpleFbConnectPostLoginManagerTest.php, line 217
Class
- SimpleFbConnectPostLoginManagerTest
- @coversDefaultClass Drupal\simple_fb_connect\SimpleFbConnectPostLoginManager @group simple_fb_connect
Namespace
Drupal\Tests\simple_fb_connect\UnitCode
protected function generateStubUrl($external, $path) {
$url = $this
->getMockBuilder('Drupal\\Core\\Url')
->disableOriginalConstructor()
->setMethods([
'isExternal',
'toString',
])
->getMock();
$url
->expects($this
->any())
->method('isExternal')
->willReturn($external);
$url
->expects($this
->any())
->method('toString')
->willReturn($path);
return $url;
}