Example #1
0
 function testSend()
 {
     $client = new DemocracyInAction_Client();
     list($status, $data) = $client->send(authentication_url(), array('email' => test_user(), 'password' => test_pass()), 'post');
     $this->assertWantedPattern('/Successful Login/', $data);
     $url = 'https://' . test_node() . '/api/getObjects.sjs';
     list($status, $data) = $client->send($url, array('object' => 'supporter', 'limit' => 1));
     $this->assertWantedPattern('/organization_KEY="1"/', $data);
 }
Example #2
0
 function testAuthenticateUrl()
 {
     $api = new DemocracyInAction_Client('sandbox.democracyinaction.org', 'email', 'password');
     $this->assertEqual($api->authentication_url(), 'https://sandbox.democracyinaction.org/api/authenticate.sjs');
 }