function IFrameUrlHelperTest::testIsSecure
Same name in other branches
- 9 core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php \Drupal\Tests\media\Unit\IFrameUrlHelperTest::testIsSecure()
- 10 core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php \Drupal\Tests\media\Unit\IFrameUrlHelperTest::testIsSecure()
- 11.x core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php \Drupal\Tests\media\Unit\IFrameUrlHelperTest::testIsSecure()
Tests that isSecure() behaves properly.
@covers ::isSecure
@dataProvider providerIsSecure
Parameters
string $url: The URL to test for security.
string $base_url: The base URL to compare $url against.
bool $secure: The expected result of isSecure().
File
-
core/
modules/ media/ tests/ src/ Unit/ IFrameUrlHelperTest.php, line 78
Class
- IFrameUrlHelperTest
- @coversDefaultClass \Drupal\media\IFrameUrlHelper
Namespace
Drupal\Tests\media\UnitCode
public function testIsSecure($url, $base_url, $secure) {
$request_context = $this->prophesize(RequestContext::class);
$request_context->getCompleteBaseUrl()
->willReturn($base_url);
$url_helper = new IFrameUrlHelper($request_context->reveal(), $this->prophesize(PrivateKey::class)
->reveal());
$this->assertSame($secure, $url_helper->isSecure($url));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.