You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RemoteTest.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. require_once('common.php');
  3. require_once('PHPUnit/Autoload.php');
  4. require_once('Zend/XmlRpc/Client.php');
  5. require_once('Zend/Http/Client.php');
  6. require_once('Zend/Registry.php');
  7. abstract class RemoteTest extends PHPUnit_Framework_TestCase {
  8. protected $server_url = 'http://orange/david/postfixadmin/xmlrpc.php';
  9. protected $username = 'roger@example.com';
  10. protected $password = 'patchthedog';
  11. /* xmlrpc objects... */
  12. protected $user;
  13. protected $vacation;
  14. protected $alias;
  15. public function setUp() {
  16. parent::setUp();
  17. $this->xmlrpc_client = new Zend_XmlRpc_Client($this->server_url);
  18. $http_client = $this->xmlrpc_client->getHttpClient();
  19. $http_client->setCookieJar();
  20. $login_object = $this->xmlrpc_client->getProxy('login');
  21. $success = $login_object->login($this->username, $this->password);
  22. if(!$success) {
  23. var_dump($success);
  24. die("Failed to login to xmlrpc interface");
  25. }
  26. }
  27. }
  28. /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */