'anything'); try { $simplePost = new Zend_Service_Delicious_SimplePost($post); $this->fail('Expected Zend_Service_Delicious_Exception not thrown'); } catch (Zend_Service_Delicious_Exception $e) { $this->assertContains('Title and URL', $e->getMessage()); } } /** * Ensures that the constructor throws an exception when the URL is missing * * @return void */ public function testConstructExceptionUrlMissing() { $post = array('d' => 'anything'); try { $simplePost = new Zend_Service_Delicious_SimplePost($post); $this->fail('Expected Zend_Service_Delicious_Exception not thrown'); } catch (Zend_Service_Delicious_Exception $e) { $this->assertContains('Title and URL', $e->getMessage()); } } /** * Ensures that getUrl() behaves as expected * * @return void */ public function testGetUrl() { $url = 'something'; $post = array( 'd' => 'anything', 'u' => $url ); $simplePost = new Zend_Service_Delicious_SimplePost($post); $this->assertEquals( $url, $result = $simplePost->getUrl(), "Expected getUrl() to return '$url'; got '$result' instead" ); } /** * Ensures that getTitle() behaves as expected * * @return void */ public function testGetTitle() { $title = 'something'; $post = array( 'd' => $title, 'u' => 'anything' ); $simplePost = new Zend_Service_Delicious_SimplePost($post); $this->assertEquals( $title, $result = $simplePost->getTitle(), "Expected getTitle() to return '$title'; got '$result' instead" ); } /** * Ensures that getNotes() behaves as expected * * @return void */ public function testGetNotes() { $notes = 'something'; $post = array( 'd' => 'anything', 'u' => 'anything', 'n' => $notes ); $simplePost = new Zend_Service_Delicious_SimplePost($post); $this->assertEquals( $notes, $result = $simplePost->getNotes(), "Expected getNotes() to return '$notes'; got '$result' instead" ); } /** * Ensures that getTags() behaves as expected * * @return void */ public function testGetTags() { $tags = 'something'; $post = array( 'd' => 'anything', 'u' => 'anything', 't' => $tags ); $simplePost = new Zend_Service_Delicious_SimplePost($post); $this->assertEquals( $tags, $result = $simplePost->getTags(), "Expected getTags() to return '$tags'; got '$result' instead" ); } }