public function SimpleFbConnectPostLoginManagerTest::testGetPostLoginPathWithInvalidQueryParameter 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::testGetPostLoginPathWithInvalidQueryParameter()
Tests getPostLoginPath method with invalid query parameter.
In this situation we are expected to use the path found in module settings.
@covers ::getPostLoginPath @covers ::validateInternalPath
File
- tests/
src/ Unit/ SimpleFbConnectPostLoginManagerTest.php, line 119
Class
- SimpleFbConnectPostLoginManagerTest
- @coversDefaultClass Drupal\simple_fb_connect\SimpleFbConnectPostLoginManager @group simple_fb_connect
Namespace
Drupal\Tests\simple_fb_connect\UnitCode
public function testGetPostLoginPathWithInvalidQueryParameter() {
// 1. Path from query parameter.
$query_path = 'http://www.example.com';
$this->persistentDataHandler
->expects($this
->once())
->method('get')
->with('post_login_path')
->willReturn($query_path);
$query_url = FALSE;
// 2. Path from module settings.
$module_path = $this->configFactory
->get('simple_fb_connect.settings')
->get('post_login_path');
$module_url = $this
->generateStubUrl(FALSE, $module_path);
$this->pathValidator
->expects($this
->any())
->method('getUrlIfValid')
->will($this
->onConsecutiveCalls($query_url, $module_url));
$this
->assertEquals($module_path, $this->postLoginManager
->getPostLoginPath());
}