function RssResponseRelativeUrlFilterTest::testOnResponse
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php \Drupal\Tests\Core\EventSubscriber\RssResponseRelativeUrlFilterTest::testOnResponse()
- 8.9.x core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php \Drupal\Tests\Core\EventSubscriber\RssResponseRelativeUrlFilterTest::testOnResponse()
- 10 core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php \Drupal\Tests\Core\EventSubscriber\RssResponseRelativeUrlFilterTest::testOnResponse()
@dataProvider providerTestOnResponse
Parameters
string $content: The content for the request.
string $expected_content: The expected content from the response.
File
-
core/
tests/ Drupal/ Tests/ Core/ EventSubscriber/ RssResponseRelativeUrlFilterTest.php, line 119
Class
- RssResponseRelativeUrlFilterTest
- @coversDefaultClass \Drupal\Core\EventSubscriber\RssResponseRelativeUrlFilter @group event_subscriber
Namespace
Drupal\Tests\Core\EventSubscriberCode
public function testOnResponse($content, $expected_content) : void {
$event = new ResponseEvent($this->prophesize(HttpKernelInterface::class)
->reveal(), Request::create('/'), HttpKernelInterface::MAIN_REQUEST, new Response($content, 200, [
'Content-Type' => 'application/rss+xml',
]));
$url_filter = new RssResponseRelativeUrlFilter();
$url_filter->onResponse($event);
$this->assertEquals($expected_content, $event->getResponse()
->getContent());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.