/** * Method to handle the <category> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleCategory(JFeed $feed, SimpleXMLElement $el) { // Get the data from the element. $domain = (string) $el['domain']; $category = (string) $el; $feed->addCategory($category, $domain); }
/** * Tests the JFeed::addCategory method. * * @return void * * @since 3.0 * * @covers JFeed::addCategory */ public function testAddCategory() { $this->object->addCategory('category1', 'http://www.example.com'); $properties = TestReflection::getValue($this->object, 'properties'); $this->assertEquals('http://www.example.com', $properties['categories']['category1']); }