public function IFrameUrlHelperTest::testIsSecure in Drupal 9
Same name and namespace in other branches
- 8 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));
}