Ejemplo n.º 1
0
 public function testPost()
 {
     Zend_Feed::setHttpClient(new TestClient());
     $entry = new Zend_Feed_Entry_Atom();
     /* Give the entry its initial values. */
     $entry->title = 'Entry 1';
     $entry->content = '1.1';
     $entry->content['type'] = 'text';
     /* Do the initial post. The base feed URI is the same as the
      * POST URI, so just supply save() with that. */
     $entry->save($this->_uri);
     /* $entry will be filled in with any elements returned by the
      * server (id, updated, link rel="edit", etc). */
     $this->assertEquals('1', $entry->id(), 'Expected id to be 1');
     $this->assertEquals('Entry 1', $entry->title(), 'Expected title to be "Entry 1"');
     $this->assertEquals('1.1', $entry->content(), 'Expected content to be "1.1"');
     $this->assertEquals('text', $entry->content['type'], 'Expected content/type to be "text"');
     $this->assertEquals('2005-05-23T16:26:00-08:00', $entry->updated(), 'Expected updated date of 2005-05-23T16:26:00-08:00');
     $this->assertEquals('http://fubar.com/myFeed/1/1/', $entry->link('edit'), 'Expected edit URI of http://fubar.com/myFeed/1/1/');
 }