mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
Phpunit updates (fix phpunit run, should fix build) (#1016)
should fix build, which is currently failing due to a stale phpunit config and poor choice of class name
This commit is contained in:
1 parent
c6773f8390
commit
ca4dae3ffe
6 files changed
+22
-16
No files matched your search
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
abstract class RemoteTestCase extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $server_url = 'http://change.me/to/work';
|
||||
protected $username = 'user@example.com';
|
||||
protected $password = 'password1';
|
||||
|
||||
/* xmlrpc objects... */
|
||||
protected $user;
|
||||
protected $vacation;
|
||||
protected $alias;
|
||||
|
||||
protected $xmlrpc_client;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
if ($this->server_url == 'http://change.me/to/work') {
|
||||
$this->markTestSkipped("Test skipped; Configuration change to \$this->server_url required");
|
||||
}
|
||||
|
||||
if (!class_exists('Zend_XmlRpc_Client', true)) {
|
||||
$this->markTestSkipped("Test skipped; Zend_XmlRpc_Client not found");
|
||||
}
|
||||
|
||||
$this->xmlrpc_client = new Zend_XmlRpc_Client($this->server_url);
|
||||
$http_client = $this->xmlrpc_client->getHttpClient();
|
||||
$http_client->setCookieJar();
|
||||
|
||||
$login_object = $this->xmlrpc_client->getProxy('login');
|
||||
$success = $login_object->login($this->username, $this->password);
|
||||
|
||||
if (!$success) {
|
||||
die("Failed to login to xmlrpc interface");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
|
||||
Reference in new issue
Block a user