add ZF1 as a dependency and phpunit; remove require/include calls from tests/

pull/154/head
David Goodwin 7 years ago
parent 9462c0cb7b
commit 12242b0893

@ -6,13 +6,17 @@
"scripts": {
"check-format": "php-cs-fixer fix --ansi --dry-run --diff",
"format": "php-cs-fixer fix --ansi",
"lint": "@php ./vendor/bin/parallel-lint --exclude vendor/ ."
"lint": "@php ./vendor/bin/parallel-lint --exclude vendor/ .",
"test": "@php ./vendor/bin/phpunit tests/"
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.7",
"jakub-onderka/php-parallel-lint": "^0.9.2"
"jakub-onderka/php-parallel-lint": "^0.9.2",
"phpunit/phpunit": "^5.7",
"zendframework/zendframework1": "^1.12.0"
}
}

1597
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -2,12 +2,6 @@
require_once('common.php');
require_once('PHPUnit/Autoload.php');
require_once('Zend/XmlRpc/Client.php');
require_once('Zend/Http/Client.php');
require_once('Zend/Registry.php');
abstract class RemoteTest extends PHPUnit_Framework_TestCase {
protected $server_url = 'http://orange/david/postfixadmin/xmlrpc.php';
protected $username = 'roger@example.com';
@ -20,6 +14,7 @@ abstract class RemoteTest extends PHPUnit_Framework_TestCase {
public function setUp() {
parent::setUp();
$this->xmlrpc_client = new Zend_XmlRpc_Client($this->server_url);
$http_client = $this->xmlrpc_client->getHttpClient();
$http_client->setCookieJar();
@ -28,7 +23,6 @@ abstract class RemoteTest extends PHPUnit_Framework_TestCase {
$success = $login_object->login($this->username, $this->password);
if (!$success) {
var_dump($success);
die("Failed to login to xmlrpc interface");
}
}

@ -8,21 +8,7 @@
require_once('RemoteTest.php');
class RemoteUserTest extends RemoteTest {
public function __construct() {
parent::__construct();
global $CONF;
}
/**
* Adds the test recipient data to the database.
*/
public function setUp() {
parent::setUp();
}
public function tearDown() {
parent::tearDown();
}
public function testChangePassword() {
try {

@ -8,29 +8,22 @@
require_once('RemoteTest.php');
class RemoteVacationTest extends RemoteTest {
public function __construct() {
parent::__construct();
global $CONF;
// Ensure config.inc.php is vaguely correct.
if ($CONF['vacation'] != 'YES' || $CONF['vacation_control'] != "YES") {
die("Cannot run tests; vacation not enabled - see config.inc.php");
}
if ($CONF['vacation_domain'] != 'autoreply.example.com') {
die("Cannot run tests; vacation_domain is not set to autoreply.example.com - see config.inc.php");
}
}
/**
* Adds the test recipient data to the database.
*/
public function setUp() {
// Ensure config.inc.php is vaguely correct.
global $CONF;
if ($CONF['vacation'] != 'YES' || $CONF['vacation_control'] != "YES") {
$this->markTestSkipped("Cannot run tests; vacation not enabled - see config.inc.php");
}
if ($CONF['vacation_domain'] != 'autoreply.example.com') {
$this->markTestSkipped("Cannot run tests; vacation_domain is not set to autoreply.example.com - see config.inc.php");
}
parent::setUp();
}
public function tearDown() {
parent::tearDown();
}
public function testIsVacationSupported() {
try {

Loading…
Cancel
Save