Drupal.org
https://www.drupal.org
Come for the software, stay for the community
D rupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.enDrupal 8 turns one!
https://www.drupal.org/blog/drupal-8-turns-one
<a href="localhost/node/1">Hello</a>
RSS;
$valid_expected_feed = <<Drupal.org
https://www.drupal.org
Come for the software, stay for the community
D rupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.enDrupal 8 turns one!
https://www.drupal.org/blog/drupal-8-turns-one
<a href="localhost/node/1">Hello</a>
RSS;
$data['valid-feed'] = [$valid_feed, $valid_expected_feed];
$invalid_feed = <<Drupal.org
https://www.drupal.org
Come for the software, stay for the community
D rupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.enDrupal 8 turns one!
https://www.drupal.org/blog/drupal-8-turns-one
//-->
//-->
]]>
RSS;
$data['invalid-feed'] = [$invalid_feed, $invalid_feed];
return $data;
}
/**
* @dataProvider providerTestOnResponse
*
* @param string $content
* @param string $expected_content
*/
public function testOnResponse($content, $expected_content) {
$event = new FilterResponseEvent(
$this->prophesize(HttpKernelInterface::class)->reveal(),
Request::create('/'),
'foo',
new Response($content, 200, [
'Content-Type' => 'application/rss+xml'
])
);
$url_filter = new RssResponseRelativeUrlFilter();
$url_filter->onResponse($event);
$this->assertEquals($expected_content, $event->getResponse()->getContent());
}
}