function RssResponseCdataTest::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/RssResponseCdataTest.php, line 125

Class

RssResponseCdataTest
@coversDefaultClass \Drupal\Core\EventSubscriber\RssResponseCdata @group event_subscriber

Namespace

Drupal\Tests\Core\EventSubscriber

Code

public function testOnResponse(string $content, string $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 RssResponseCdata();
    $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.