function OEmbedIframeControllerTest::testBadHashParameter
Same name in other branches
- 9 core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php \Drupal\Tests\media\Kernel\OEmbedIframeControllerTest::testBadHashParameter()
- 10 core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php \Drupal\Tests\media\Kernel\OEmbedIframeControllerTest::testBadHashParameter()
- 11.x core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php \Drupal\Tests\media\Kernel\OEmbedIframeControllerTest::testBadHashParameter()
Tests validation of the 'hash' query string parameter.
@dataProvider providerBadHashParameter
@covers ::render
Parameters
string $hash: The 'hash' query string parameter.
File
-
core/
modules/ media/ tests/ src/ Kernel/ OEmbedIframeControllerTest.php, line 40
Class
- OEmbedIframeControllerTest
- @coversDefaultClass \Drupal\media\Controller\OEmbedIframeController
Namespace
Drupal\Tests\media\KernelCode
public function testBadHashParameter($hash) {
/** @var callable $controller */
$controller = $this->container
->get('controller_resolver')
->getControllerFromDefinition('\\Drupal\\media\\Controller\\OEmbedIframeController::render');
$this->assertIsCallable($controller);
$this->expectException('\\Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException');
$this->expectExceptionMessage('This resource is not available');
$request = new Request([
'url' => 'https://example.com/path/to/resource',
'hash' => $hash,
]);
$controller($request);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.