diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 50a1309f..bc6261f3 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -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 }} diff --git a/composer.json b/composer.json index 78a571a7..e08eae1c 100644 --- a/composer.json +++ b/composer.json @@ -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" }, diff --git a/public/upgrade.php b/public/upgrade.php index 8ca53aaa..0f564772 100644 --- a/public/upgrade.php +++ b/public/upgrade.php @@ -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"; } diff --git a/tests/AliasHandlerTest.php b/tests/AliasHandlerTest.php index 76d3df8a..b6e685c6 100644 --- a/tests/AliasHandlerTest.php +++ b/tests/AliasHandlerTest.php @@ -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'); diff --git a/tests/CreatePageBrowserTest.php b/tests/CreatePageBrowserTest.php index 51abe158..2e2beeaf 100644 --- a/tests/CreatePageBrowserTest.php +++ b/tests/CreatePageBrowserTest.php @@ -1,7 +1,7 @@ cleanup(); } diff --git a/tests/DbBasicTest.php b/tests/DbBasicTest.php index dd6750bd..c18fb68e 100644 --- a/tests/DbBasicTest.php +++ b/tests/DbBasicTest.php @@ -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; diff --git a/tests/MailboxHandlerTest.php b/tests/MailboxHandlerTest.php index 8f6a6899..7905d88f 100644 --- a/tests/MailboxHandlerTest.php +++ b/tests/MailboxHandlerTest.php @@ -1,7 +1,7 @@ assertEquals($this->alias->get(), array()); diff --git a/tests/RemoteTest.php b/tests/RemoteTest.php index 5f2ba1bf..b95e077b 100644 --- a/tests/RemoteTest.php +++ b/tests/RemoteTest.php @@ -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') { diff --git a/tests/RemoteVacationTest.php b/tests/RemoteVacationTest.php index 0fccb9ad..3a5f43c3 100644 --- a/tests/RemoteVacationTest.php +++ b/tests/RemoteVacationTest.php @@ -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() { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c4362aee..01186271 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -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 {