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.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. require_once('common.php');
  3. abstract class RemoteTest extends PHPUnit_Framework_TestCase {
  4. protected $server_url = 'http://change.me/to/work'; // http://orange/david/postfixadmin/xmlrpc.php';
  5. protected $username = 'user@example.com';
  6. protected $password = 'password1';
  7. /* xmlrpc objects... */
  8. protected $user;
  9. protected $vacation;
  10. protected $alias;
  11. public function setUp() {
  12. parent::setUp();
  13. if ($this->server_url == 'http://change.me/to/work') {
  14. $this->markTestSkipped("Test skipped; Configuration change to \$this->server_url required");
  15. }
  16. if (!class_exists('Zend_XmlRpc_Client', true)) {
  17. $this->markTestSkipped("Test skipped; Zend_XmlRpc_Client not found");
  18. }
  19. $this->xmlrpc_client = new Zend_XmlRpc_Client($this->server_url);
  20. $http_client = $this->xmlrpc_client->getHttpClient();
  21. $http_client->setCookieJar();
  22. $login_object = $this->xmlrpc_client->getProxy('login');
  23. $success = $login_object->login($this->username, $this->password);
  24. if (!$success) {
  25. die("Failed to login to xmlrpc interface");
  26. }
  27. }
  28. }
  29. /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */