Beispiel #1
0
 function xtestCreateFilter()
 {
     $rules = array(new Services_Gnip_Rule("actor", "me"), new Services_Gnip_Rule("actor", "you"), new Services_Gnip_Rule("actor", "bob"));
     $f = new Services_Gnip_Filter('test', 'true', '', $rules);
     $this->helper->expect('post', '/publishers/digg/filters.xml', array('value' => $f->toXML()));
     $this->gnip->createFilter("digg", $f);
 }
Beispiel #2
0
 function testToXmlWithpostUrl()
 {
     $expected_xml = '<filter name="test" fullData="true">' . '<postURL>http://example.com</postURL>' . '<rule type="actor">me</rule>' . '<rule type="actor">you</rule>' . '<rule type="actor">bob</rule>' . '</filter>';
     $rules = array(new Services_Gnip_Rule("actor", "me"), new Services_Gnip_Rule("actor", "you"), new Services_Gnip_Rule("actor", "bob"));
     $f = new Services_Gnip_Filter('test', 'true', 'http://example.com', $rules);
     $this->assertEquals($expected_xml, $f->toXML());
 }
Beispiel #3
0
 /**
  * Test the ability to create a Gnip filter with strings -- with Jid --
  * and compare against generated XML.
  *
  * @access    public
  * @param     void
  * @return    void
  */
 function testToXmlWithJid()
 {
     $expected_xml = '<filter name="test" fullData="true">' . '<jid>joe@jabber.org</jid>' . '<rule type="actor" value="me"/>' . '<rule type="actor" value="you"/>' . '<rule type="actor" value="bob"/>' . '</filter>';
     $rules = array(new Services_Gnip_Rule("actor", "me"), new Services_Gnip_Rule("actor", "you"), new Services_Gnip_Rule("actor", "bob"));
     $f = new Services_Gnip_Filter("test", "true", "", "*****@*****.**", $rules);
     $this->assertEquals($expected_xml, $f->toXML());
 }
Beispiel #4
0
 /**
  * Test the ability to create a filter for a Gnip publisher.
  *
  * @access    public
  * @param     void
  * @return    void
  */
 function testCreateFilter()
 {
     $rules = array(new Services_Gnip_Rule("actor", "me"), new Services_Gnip_Rule("actor", "you"), new Services_Gnip_Rule("actor", "bob"));
     $f = new Services_Gnip_Filter("test", "true", "", "", $rules);
     $this->helper->expect("post", "/publishers/digg/filters.xml", array("value" => $f->toXML()));
     $this->gnip->createFilter("digg", $f);
 }