/** * @covers WindowsAzure\Common\Internal\Atom\Feed::getEntry * @covers WindowsAzure\Common\Internal\Atom\Feed::setEntry */ public function testGetSetEntry() { // Setup $expected = 'testEntry'; $feed = new Feed(); // Test $feed->setEntry($expected); $actual = $feed->getEntry(); // Assert $this->assertEquals($expected, $actual); }
/** * Get array of properties of atom entites passed via feed or single entry * * @param string $xmlString Atom xml * * @return array of properties arrays */ protected function getEntryList($xmlString) { $xml = simplexml_load_string($xmlString); if ($xml->getName() == Resources::ENTRY) { $entry = new Entry(); $entry->fromXml($xml); $entries = array($entry); } else { $feed = new Feed(); $feed->parseXml($xmlString); $entries = $feed->getEntry(); } $result = array(); if (is_array($entries)) { foreach ($entries as $entry) { $properties = $this->getPropertiesFromAtomEntry($entry); if (!empty($properties)) { $result[] = $properties; } } } return $result; }