update to phpunit v8, try changing coveralls library, update github action

pull/348/head
David Goodwin 4 years ago
parent 5e8ce2b5b0
commit 3cd62f9f4f

@ -29,7 +29,6 @@ jobs:
run: mkdir -p build/logs || true
- name: Coveralls
run: php vendor/bin/php-coveralls -v --coverage_clover=coverage.xml || true
run: vendor/bin/coveralls ./clover.xml
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

@ -14,7 +14,7 @@
"check-format": "php-cs-fixer fix --ansi --dry-run --diff",
"format": "php-cs-fixer fix --ansi",
"lint": "@php ./vendor/bin/parallel-lint --exclude vendor/ --exclude lib/block_random_int.php --exclude lib/array_column.php .",
"test": "DATABASE=sqlite ./vendor/bin/phpunit --coverage-clover ./coverage.xml tests/",
"test": "DATABASE=sqlite ./vendor/bin/phpunit --coverage-clover ./clover.xml tests/",
"test-fixup": "mkdir -p templates_c ; test -f config.local.php || touch config.local.php",
"psalm": "@php ./vendor/bin/psalm --no-cache --show-info=false "
},
@ -27,8 +27,8 @@
"friendsofphp/php-cs-fixer": "*",
"php-parallel-lint/php-parallel-lint": "^1.0",
"php": ">7.2.0",
"php-coveralls/php-coveralls" : "*",
"phpunit/phpunit": "^6|^7",
"cedx/coveralls": "^11.0",
"phpunit/phpunit": "8.*",
"vimeo/psalm":"^3.0",
"shardj/zf1-future" : "^1.12"
},

@ -103,7 +103,7 @@ function _db_add_field($table, $field, $fieldtype, $after = '') {
function echo_out($text) {
if (defined('PHPUNIT_TEST')) {
error_log("" . $text);
//error_log("" . $text);
} else {
echo $text . "\n";
}

@ -9,7 +9,7 @@ class AliasHandlerTest extends \PHPUnit\Framework\TestCase {
$this->assertEmpty($results);
}
public function tearDown() {
public function tearDown() : void {
$_SESSION = [];
db_query('DELETE FROM alias');
db_query('DELETE FROM domain');

@ -1,7 +1,7 @@
<?php
class CreatePageBrowserTest extends \PHPUnit\Framework\TestCase {
public function tearDown() {
public function tearDown() : void {
$this->cleanup();
}

@ -3,7 +3,7 @@
class DbBasicTest extends \PHPUnit\Framework\TestCase {
private $test_domain;
public function setUp() {
public function setUp() : void {
$db = db_connect();
$test_domain = 'test' . uniqid() . '.com';
$this->test_domain = $test_domain;

@ -1,7 +1,7 @@
<?php
class MailboxHandlerTest extends \PHPUnit\Framework\TestCase {
public function tearDown() {
public function tearDown() : void {
db_query('DELETE FROM mailbox');
db_query('DELETE FROM domain');
db_query('DELETE FROM domain_admins');

@ -13,17 +13,6 @@ class RemoteAliasTest extends RemoteTest {
global $CONF;
}
/**
* Adds the test recipient data to the database.
*/
public function setUp() {
parent::setUp();
}
public function tearDown() {
parent::tearDown();
}
public function testGet() {
/* although we created an alias record, for users, this isn't returned... */
$this->assertEquals($this->alias->get(), array());

@ -12,7 +12,7 @@ abstract class RemoteTest extends \PHPUnit\Framework\TestCase {
protected $xmlrpc_client;
public function setUp() {
public function setUp() : void {
parent::setUp();
if ($this->server_url == 'http://change.me/to/work') {

@ -13,7 +13,7 @@ class RemoteVacationTest extends RemoteTest {
/**
* Adds the test recipient data to the database.
*/
public function setUp() {
public function setUp() : void {
// Ensure config.inc.php is vaguely correct.
global $CONF;
if ($CONF['vacation'] != 'YES' || $CONF['vacation_control'] != "YES") {
@ -36,7 +36,7 @@ class RemoteVacationTest extends RemoteTest {
public function testGetDetails() {
$details = $this->vacation->getDetails();
$this->assertFalse($details); // empty by default (thansk to tearDown/setUp);
$this->assertFalse($details); // empty by default (thanks to tearDown/setUp);
}
public function testSetAway() {

@ -22,7 +22,7 @@ if (getenv('DATABASE') == 'sqlite' || getenv('DATABASE') == false) {
}
touch($db_file);
echo "Using: SQLite database for tests - $db_file \n";
error_log("Using: SQLite database for tests - $db_file");
}
if (getenv('DATABASE') == 'postgresql') {
$user = getenv('PGUSER') ?: 'postgres';
@ -40,7 +40,7 @@ if (getenv('DATABASE') == 'postgresql') {
Config::write('database_name', 'postfixadmin');
Config::write('database_host', $host);
echo "Using: PostgreSQL database for tests\n";
error_log("Using: PostgreSQL database for tests\n");
}
if (getenv('DATABASE') == 'mysql') {
@ -76,7 +76,7 @@ if (getenv('DATABASE') == 'mysql') {
Config::write('database_password', $config['password']);
Config::write('database_name', 'postfixadmin');
echo "Using: MySQL database for tests\n";
error_log("Using: MySQL database for tests");
}
try {

Loading…
Cancel
Save