TestMediaFilterController.php
Same filename and directory in other branches
- 8.9.x core/modules/media/tests/modules/media_test_ckeditor/src/Controller/TestMediaFilterController.php
- 10 core/modules/media/tests/modules/media_test_embed/src/Controller/TestMediaFilterController.php
- 9 core/modules/media/tests/modules/media_test_embed/src/Controller/TestMediaFilterController.php
- main core/modules/media/tests/modules/media_test_embed/src/Controller/TestMediaFilterController.php
Namespace
Drupal\media_test_embed\ControllerFile
-
core/
modules/ media/ tests/ modules/ media_test_embed/ src/ Controller/ TestMediaFilterController.php
View source
<?php
declare (strict_types=1);
namespace Drupal\media_test_embed\Controller;
use Drupal\filter\FilterFormatInterface;
use Drupal\media\Controller\MediaFilterController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Controller to allow testing of error handling of Media Embed in text editors.
*/
class TestMediaFilterController extends MediaFilterController {
/**
* {@inheritdoc}
*/
public function preview(Request $request, FilterFormatInterface $filter_format) {
if (\Drupal::state()->get('test_media_filter_controller_throw_error', FALSE)) {
throw new NotFoundHttpException();
}
return parent::preview($request, $filter_format);
}
}
Classes
| Title | Deprecated | Summary |
|---|---|---|
| TestMediaFilterController | Controller to allow testing of error handling of Media Embed in text editors. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.