set_raw_data($xml); $feed->enable_cache(false); $feed->init(); return $feed; } public static function titleprovider() { return array( array('Feed Title', 'Feed Title'), // RSS Profile tests array('AT&T', 'AT&T'), array('AT&T', 'AT&T'), array("Bill & Ted's Excellent Adventure", "Bill & Ted's Excellent Adventure"), array("Bill & Ted's Excellent Adventure", "Bill & Ted's Excellent Adventure"), array('The & entity', 'The & entity'), array('The & entity', 'The & entity'), array('The &amp; entity', 'The &amp; entity'), array('The &amp; entity', 'The &amp; entity'), array('I <3 Phil Ringnalda', 'I <3 Phil Ringnalda'), array('I <3 Phil Ringnalda', 'I <3 Phil Ringnalda'), array('A < B', 'A < B'), array('A < B', 'A < B'), array('A<B', 'A<B'), array('A<B', 'A<B'), array("Nice <gorilla> what's he weigh?", "Nice <gorilla> what's he weigh?"), array("Nice <gorilla> what's he weigh?", "Nice <gorilla> what's he weigh?"), ); } /** * @dataProvider titleprovider */ public function testTitleRSS20($title, $expected) { $data = ' %s '; $feed = $this->checkFromTemplate($data, $title, $expected); $this->assertEquals($expected, $feed->get_title()); } /** * @dataProvider titleprovider */ public function testTitleRSS20WithDC10($title, $expected) { $data = ' %s '; $feed = $this->checkFromTemplate($data, $title, $expected); $this->assertEquals($expected, $feed->get_title()); } /** * @dataProvider titleprovider */ public function testTitleRSS20WithDC11($title, $expected) { $data = ' %s '; $feed = $this->checkFromTemplate($data, $title, $expected); $this->assertEquals($expected, $feed->get_title()); } /** * @dataProvider titleprovider */ public function testTitleRSS20WithAtom03($title, $expected) { $data = ' %s '; $feed = $this->checkFromTemplate($data, $title, $expected); $this->assertEquals($expected, $feed->get_title()); } /** * @dataProvider titleprovider */ public function testTitleRSS20WithAtom10($title, $expected) { $data = ' %s '; $feed = $this->checkFromTemplate($data, $title, $expected); $this->assertEquals($expected, $feed->get_title()); } /** * Based on a test from old bug 18 * * @dataProvider titleprovider */ public function testTitleRSS20WithImageTitle($title, $expected) { $data = ' %s Image title '; $feed = $this->checkFromTemplate($data, $title, $expected); $this->assertEquals($expected, $feed->get_title()); } /** * Based on a test from old bug 18 * * @dataProvider titleprovider */ public function testTitleRSS20WithImageTitleReversed($title, $expected) { $data = ' Image title %s '; $feed = $this->checkFromTemplate($data, $title, $expected); $this->assertEquals($expected, $feed->get_title()); } }