tests/UnitTests/POData/Writers/Atom/AtomODataWriterTest.php
/**
	 * Test for top level Entry Item with media link.
	 */
Test for top level Entry Item with media link.
Test for top level Entry Item with media link .
public function testWriteMediaEntry()
    {
    	$entry1 = new ODataEntry();
    	$entry1->id = 'Entry 1';
    	$entry1->title = 'Entry Title';
    	$editLink = new ODataLink();
    	$editLink->name = "edit";
    	$editLink->tytle = "Edit Link Title";
    	$editLink->type = "Edit link type";
    	$editLink->url = "Edit Link URL";
    	$entry1->editLink = $editLink;
    	$selfLink = new ODataLink();
    	$selfLink->name = "self";
    	$selfLink->tytle = "self Link Title";
    	$selfLink->type = "";
    	$selfLink->url = "Self Link URL";
    	$entry1->selfLink = $selfLink;
    	$entry1->mediaLink = new ODataMediaLink("Thumbnail_600X450", "http://storage.live.com/123/christmas-tree-with-presents.jpg", "http://cdn-8.nflximg.com/US/boxshots/large/5632678.jpg", "image/jpg", time());
    	$entry1->mediaLinks = array(new ODataMediaLink('Media Link Name',
                                                      'Edit Media link', 
                                                      'Src Media Link', 
                                                      'Media Content Type', 
                                                      'Media ETag'),
    	                                    new ODataMediaLink('Media Link Name2', 
                                                      'Edit Media link2', 
                                                      'Src Media Link2', 
                                                      'Media Content Type2', 
                                                      'Media ETag2'));
        $entry1->links = array();
        $entry1->eTag = 'Entry ETag';
        $entry1->isMediaLinkEntry = true;
        $propCont = new ODataPropertyContent ();
        $propCont->properties = array ();
        $entry1->propertyContent = $propCont;
	    $writer = new AtomODataWriter('http://localhost/NorthWind.svc');
	    $result = $writer->write($entry1);
	    $this->assertSame($writer, $result);
	    $actual = $writer->getOutput();
	    $expected = '<x/>';
	    $this->markTestSkipped("see #75 DOMDocument::loadXML(): Namespace prefix m for etag on entry is not defined in Entity, line: 2");
	    $this->assertXmlStringEqualsXmlString($this->removeUpdatedTags($expected), $actual);
    }
public function testWriteMediaEntry ( ) { $ entry1 = new ODataEntry ( ) ; $ entry1 -> id = 'Entry 1' ; $ entry1 -> title = 'Entry Title' ; $ editLink = new ODataLink ( ) ; $ editLink -> name = " edit " ; $ editLink -> tytle = " Edit Link Title " ; $ editLink -> type = " Edit link type " ; $ editLink -> url = " Edit Link URL " ; $ entry1 -> editLink = $ editLink ; $ selfLink = new ODataLink ( ) ; $ selfLink -> name = " self " ; $ selfLink -> tytle = " self Link Title " ; $ selfLink -> type = " " ; $ selfLink -> url = " Self Link URL " ; $ entry1 -> selfLink = $ selfLink ; $ entry1 -> mediaLink = new ODataMediaLink ( " Thumbnail_600X450 " , " http://storage.live.com/123/christmas-tree-with-presents.jpg " , " http://cdn-8.nflximg.com/US/boxshots/large/5632678.jpg " , " image/jpg " , time ( ) ) ; $ entry1 -> mediaLinks = array ( new ODataMediaLink ( 'Media Link Name' , 'Edit Media link' , 'Src Media Link' , 'Media Content Type' , 'Media ETag' ) , new ODataMediaLink ( 'Media Link Name2' , 'Edit Media link2' , 'Src Media Link2' , 'Media Content Type2' , 'Media ETag2' ) ) ; $ entry1 -> links = array ( ) ; $ entry1 -> eTag = 'Entry ETag' ; $ entry1 -> isMediaLinkEntry = true ; $ propCont = new ODataPropertyContent ( ) ; $ propCont -> properties = array ( ) ; $ entry1 -> propertyContent = $ propCont ; $ writer = new AtomODataWriter ( 'http://localhost/NorthWind.svc' ) ; $ result = $ writer -> write ( $ entry1 ) ; $ this -> assertSame ( $ writer , $ result ) ; $ actual = $ writer -> getOutput ( ) ; $ expected = '<x/>' ; $ this -> markTestSkipped ( " see #75 DOMDocument::loadXML(): Namespace prefix m for etag on entry is not defined in Entity, line: 2 " ) ; $ this -> assertXmlStringEqualsXmlString ( $ this -> removeUpdatedTags ( $ expected ) , $ actual ) ; }
Test for top level Entry Item with media link.
Test for top level Entry Item with media link .