/** * @covers WindowsAzure\Common\Internal\Atom\Entry::getCategory * @covers WindowsAzure\Common\Internal\Atom\Entry::setCategory */ public function testEntryGetSetCategory() { // Setup $expected = new Category(); $expected->setTerm('testTerm'); $entry = new Entry(); // Test $entry->setCategory($expected); $actual = $entry->getCategory(); // Assert $this->assertEquals($expected->getTerm(), $actual->getTerm()); }
/** * @covers WindowsAzure\Common\Internal\Atom\Source::getCategory * @covers WindowsAzure\Common\Internal\Atom\Source::setCategory */ public function testGetSetCategory() { // Setup $expected = array(); $category = new Category(); $category->setTerm('testTerm'); $expected[] = $category; $source = new Source(); // Test $source->setCategory($expected); $actual = $source->getCategory(); // Assert $this->assertEquals($expected, $actual); }
/** * @covers WindowsAzure\Common\Internal\Atom\Category::writeXml */ public function testCategoryWriteXmlSuccessAllProperties() { // Setup $category = new Category(); $category->setTerm('testTerm'); $category->setScheme('testScheme'); $category->setLabel('testLabel'); $category->setUndefinedContent('testUndefinedContent'); $actual = new Category(); $xmlWriter = new \XMLWriter(); $xmlWriter->openMemory(); $expected = '<atom:category term="testTerm" scheme="testScheme" label="testLabel" xmlns:atom="http://www.w3.org/2005/Atom">testUndefinedContent</atom:category>'; // Test $category->writeXml($xmlWriter); $actual = $xmlWriter->outputMemory(); // Assert $this->assertEquals($expected, $actual); }