From nobody Mon Jan 23 14:09:26 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P0sRV43nKz2t7SH; Mon, 23 Jan 2023 14:09:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P0sRV3qXxz3jwn; Mon, 23 Jan 2023 14:09:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674482966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liQug5sr35zPVWzwE+ml1Kfv8sx1qINHkj1YJBxvPGc=; b=Dtn1kcJxqtGqoNB1xJSh9hpWJY/oYcslaXpzZnruKNyBJV0GiuVXbJOzxPFaiQz9714yn7 HDsVr8Fp6annuMKRKy1sWrP65z9x1cdPIVVYXzvP/j61+L6Wp3XHxHS1xUftUW/KQDBg/+ yWffY1M5EEsWe3HHduNukzs/XDP853ZGOwMdgBCtJ7b3Q9qdvpwNOFnPJsZauZIss3i8zh nCC2xu3OxwIB6N4a2vM0kEV24OfRavkWpxc5Pa6432SF0nlmmE9zCxkXAJDSIAYdPw+nNo PxH0vt99rJiJ/SMxBrTkaViC/DkY2AKwzjTblw497tGOSqOjV67GgICnQ3aeAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674482966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liQug5sr35zPVWzwE+ml1Kfv8sx1qINHkj1YJBxvPGc=; b=IXxKX3Xl+mJra4EUuqfu/CYd5/1o1ct/x48i1PMHEOYwoIMWos+4QcrLwshXF6SBgQbIOI I47RLanoViCK7izlzpC+OK5Hu6NQuHFZfhInyjBGsj9+oAh5dInOXCIIdKVQeivX8nX1JY NuihqMZFugk/+Wd8PRCJzEYUW9gIn4haptYegaSWWxL7ou4RTYqhAdDv3b5GYh2q9o0nr4 Lw2Li+V+A/ivXHGViuAEFQF6OQArD8e/Mq5ikCPSrFIaOR3ykQmFvvpADE/tRXsBkSHauw ax10iAsWvlr/FgTtCdCZAQ70ZmdmhzZKHOpnoJxmnqjHs8qKQ3PwOuKx38BK6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674482966; a=rsa-sha256; cv=none; b=BiKPdBAsRNLBD3sAXXEp/bv1ERncOhJTv3+ceoWWFPcWZgWiPW13n+OgrL1qorTN/YhTel 26YoRPR7oO1o5TUSrLYsTUx7xn/4rlX7w41javistHe4AAXwqJ5VGDKjaLZv8VboaKMIqV vEO53Y1CzSaVaZSRhjYGvPi7p41Y8qIVOEBpt3tM2LLIl8dzh96S1zXYfEH/eCZyF5gzex 3gHPAULlerfLFxV2m2pVYjK+HakGarZr48gvvDrQcKSdp5GnlpYX8ryJAK3W40pM6DjweE 5C8rW9fzEGNoy3Ao2emF+gjPG4zP/w6CpYcLN8rqBL/PCknO/alG3V+khjZN2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P0sRV2nhYzWyF; Mon, 23 Jan 2023 14:09:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30NE9QNA016376; Mon, 23 Jan 2023 14:09:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30NE9QCB016375; Mon, 23 Jan 2023 14:09:26 GMT (envelope-from git) Date: Mon, 23 Jan 2023 14:09:26 GMT Message-Id: <202301231409.30NE9QCB016375@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jochen Neumeister Subject: git: 8295feba03e1 - main - net-mgmt/icingaweb2: Update to 2.11.3 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: joneum X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8295feba03e13477dfbf426f51af3d73d01df152 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by joneum: URL: https://cgit.FreeBSD.org/ports/commit/?id=8295feba03e13477dfbf426f51af3d73d01df152 commit 8295feba03e13477dfbf426f51af3d73d01df152 Author: Jochen Neumeister AuthorDate: 2023-01-23 14:02:52 +0000 Commit: Jochen Neumeister CommitDate: 2023-01-23 14:02:52 +0000 net-mgmt/icingaweb2: Update to 2.11.3 Changelog: https://github.com/Icinga/icingaweb2/blob/master/CHANGELOG.md PR: 263115 Patch from: flo Differential Revision: https://reviews.freebsd.org/D38018 Sponsored by: Netzkommune GmbH --- net-mgmt/icinga-ipl-i18n/Makefile | 3 +- net-mgmt/icinga-php-library/Makefile | 5 +- net-mgmt/icinga-php-thirdparty/Makefile | 4 +- net-mgmt/icinga-php-thirdparty/pkg-descr | 4 +- net-mgmt/icingaweb2/Makefile | 24 +- net-mgmt/icingaweb2/distinfo | 6 +- net-mgmt/icingaweb2/files/patch-4bc5350ebaae | 1054 -------------------------- net-mgmt/icingaweb2/files/patch-dc7a8c8d8b6e | 193 ----- net-mgmt/icingaweb2/files/pkg-message.in | 14 +- net-mgmt/icingaweb2/pkg-plist | 719 +++++++++++------- 10 files changed, 483 insertions(+), 1543 deletions(-) diff --git a/net-mgmt/icinga-ipl-i18n/Makefile b/net-mgmt/icinga-ipl-i18n/Makefile index 10e99a383eab..1cef683e9f17 100644 --- a/net-mgmt/icinga-ipl-i18n/Makefile +++ b/net-mgmt/icinga-ipl-i18n/Makefile @@ -1,6 +1,7 @@ PORTNAME= icinga-ipl-i18n DISTVERSIONPREFIX= v DISTVERSION= 0.2.0 +PORTREVISION= 1 CATEGORIES= net-mgmt www PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX} @@ -20,7 +21,7 @@ GH_PROJECT= ipl-i18n NO_BUILD= yes NO_ARCH= yes -WWWDIR?= ${PREFIX}/www/icingaweb2/modules/${PORTNAME:C/^.*-//} +WWWDIR?= ${PREFIX}/www/icingaweb2/icinga-php/${PORTNAME:C/^.*-//} do-install: @${MKDIR} ${STAGEDIR}${WWWDIR} diff --git a/net-mgmt/icinga-php-library/Makefile b/net-mgmt/icinga-php-library/Makefile index 163897ea072b..44628714f657 100644 --- a/net-mgmt/icinga-php-library/Makefile +++ b/net-mgmt/icinga-php-library/Makefile @@ -1,6 +1,7 @@ PORTNAME= icinga-php-library DISTVERSIONPREFIX= v DISTVERSION= 0.10.0 +PORTREVISION= 1 CATEGORIES= net-mgmt www PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX} @@ -11,8 +12,6 @@ WWW= https://github.com/Icinga/icinga-php-library LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE -RUN_DEPENDS= icingaweb2${PHP_PKGNAMESUFFIX}>=2.4.1:net-mgmt/icingaweb2@${PHP_FLAVOR} - USES= php:web,flavors USE_GITHUB= yes @@ -21,7 +20,7 @@ GH_ACCOUNT= icinga NO_BUILD= yes NO_ARCH= yes -WWWDIR?= ${PREFIX}/www/icingaweb2/modules/${PORTNAME:C/^.*-//} +WWWDIR?= ${PREFIX}/www/icingaweb2/icinga-php/${PORTNAME:C/^.*-//} do-install: @${MKDIR} ${STAGEDIR}${WWWDIR} diff --git a/net-mgmt/icinga-php-thirdparty/Makefile b/net-mgmt/icinga-php-thirdparty/Makefile index eb66161c2149..510d7ca463bd 100644 --- a/net-mgmt/icinga-php-thirdparty/Makefile +++ b/net-mgmt/icinga-php-thirdparty/Makefile @@ -11,8 +11,6 @@ WWW= https://github.com/Icinga/icinga-php-thirdparty LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE -RUN_DEPENDS= icingaweb2${PHP_PKGNAMESUFFIX}>=2.4.1:net-mgmt/icingaweb2@${PHP_FLAVOR} - USES= php:web,flavors USE_GITHUB= yes @@ -21,7 +19,7 @@ GH_ACCOUNT= icinga NO_BUILD= yes NO_ARCH= yes -WWWDIR?= ${PREFIX}/www/icingaweb2/modules/${PORTNAME:C/^.*-//} +WWWDIR?= ${PREFIX}/www/icingaweb2/icinga-php/${PORTNAME:C/^.*-//} do-install: @${MKDIR} ${STAGEDIR}${WWWDIR} diff --git a/net-mgmt/icinga-php-thirdparty/pkg-descr b/net-mgmt/icinga-php-thirdparty/pkg-descr index fbf8ae62eca4..60d1d94334b3 100644 --- a/net-mgmt/icinga-php-thirdparty/pkg-descr +++ b/net-mgmt/icinga-php-thirdparty/pkg-descr @@ -1,2 +1,2 @@ -This project bundles all 3rd party PHP libraries used by Icinga Web products into one piece, -which can be integrated as library into Icinga Web 2. +This project bundles all 3rd party PHP libraries used by Icinga Web products +into one piece, which can be integrated as library into Icinga Web 2. diff --git a/net-mgmt/icingaweb2/Makefile b/net-mgmt/icingaweb2/Makefile index 0ab6dd4c882c..66fbb9f7362e 100644 --- a/net-mgmt/icingaweb2/Makefile +++ b/net-mgmt/icingaweb2/Makefile @@ -1,7 +1,6 @@ PORTNAME= icingaweb2 DISTVERSIONPREFIX= v -DISTVERSION= 2.8.2 -PORTREVISION= 1 +DISTVERSION= 2.11.3 CATEGORIES= net-mgmt www PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX} @@ -12,6 +11,10 @@ WWW= https://www.icinga.com/products/icinga-web-2 LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING +RUN_DEPENDS= icinga-php-library${PHP_PKGNAMESUFFIX}>=0.10.0:net-mgmt/icinga-php-library@${PHP_FLAVOR} \ + icinga-php-thirdparty${PHP_PKGNAMESUFFIX}>=0.11.0:net-mgmt/icinga-php-thirdparty@${PHP_FLAVOR} \ + icingaweb2-module-incubator${PHP_PKGNAMESUFFIX}>=0.18.0:net-mgmt/icingaweb2-module-incubator@${PHP_FLAVOR} + USES= php:build,web,flavors USE_PHP= bcmath bitset ctype curl dom gd gettext hash iconv json ldap \ mbstring mcrypt memcache memcached opcache openssl pcre pdo \ @@ -50,10 +53,15 @@ LDAP_USE= PHP=ldap post-patch: ${REINPLACE_CMD} 's%\(/etc/icingaweb2\)%${PREFIX}\1%g' \ ${WRKSRC}/library/Icinga/Application/ApplicationBootstrap.php + ${REINPLACE_CMD} 's%/var/lib/icingaweb2%/var/db/icingaweb2%g' \ + ${WRKSRC}/library/Icinga/Application/ApplicationBootstrap.php + ${REINPLACE_CMD} 's%/usr/share/icinga-php%${WWWDIR}/icinga-php%g' \ + ${WRKSRC}/library/Icinga/Application/ApplicationBootstrap.php ${REINPLACE_CMD} 's%readlink[^)]*)%"${PREFIX}/bin/php"%g' \ ${WRKSRC}/application/clicommands/WebCommand.php do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d/ + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/ ${INSTALL_DATA} ${WRKSRC}/etc/bash_completion.d/icingacli \ ${STAGEDIR}${PREFIX}/etc/bash_completion.d (cd ${WRKSRC} && ${RM} -r .mailmap changelog.py icingaweb2.spec \ @@ -65,17 +73,5 @@ do-install: ${CHMOD} 755 ${STAGEDIR}${WWWDIR}/bin/icingacli ${RLN} ${STAGEDIR}${WWWDIR}/bin/icingacli ${STAGEDIR}${PREFIX}/bin/icingacli ${MKDIR} ${STAGEDIR}${ETCDIR} - ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/ -.for webserver in apache nginx - ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/${webserver} -# ICINGAWEB_CONFIGDIR is set to /nonexistent to allow staging as user. -# Once installed, ${ETCDIR} is not world-readable, so point icingacli to -# a non existing directory. The config files are generated correctly anyway. - (cd ${STAGEDIR}${WWWDIR} && \ - ICINGAWEB_CONFIGDIR=/nonexistent \ - ./bin/icingacli setup config webserver ${webserver} --path=/icingaweb2 \ - --root=${WWWDIR}/public --config=${ETCDIR} \ - --file=${STAGEDIR}${EXAMPLESDIR}/${webserver}/icingaweb2.conf) -.endfor .include diff --git a/net-mgmt/icingaweb2/distinfo b/net-mgmt/icingaweb2/distinfo index c022c74a24dc..8d10a3f355d9 100644 --- a/net-mgmt/icingaweb2/distinfo +++ b/net-mgmt/icingaweb2/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1597858223 -SHA256 (icinga-icingaweb2-v2.8.2_GH0.tar.gz) = 47d64bc4eeb574ca4ca2f765866a1612ed885d47d53cb3e7dc19adeb10b2b3db -SIZE (icinga-icingaweb2-v2.8.2_GH0.tar.gz) = 8514166 +TIMESTAMP = 1672093379 +SHA256 (icinga-icingaweb2-v2.11.3_GH0.tar.gz) = d9c6bc452b6ecb1c46713bbb91225e1b5706cbc85c585254ea68d81f85a4fc5f +SIZE (icinga-icingaweb2-v2.11.3_GH0.tar.gz) = 11437384 diff --git a/net-mgmt/icingaweb2/files/patch-4bc5350ebaae b/net-mgmt/icingaweb2/files/patch-4bc5350ebaae deleted file mode 100644 index b3f40ec52789..000000000000 --- a/net-mgmt/icingaweb2/files/patch-4bc5350ebaae +++ /dev/null @@ -1,1054 +0,0 @@ -diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml -index 4d52983ba9..4ca606ac52 100644 -diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php -index 04cc930d20..8c72d0e513 100644 ---- library/Icinga/Application/ApplicationBootstrap.php -+++ library/Icinga/Application/ApplicationBootstrap.php -@@ -605,7 +605,7 @@ protected function setupErrorHandling() - ini_set('display_startup_errors', 1); - ini_set('display_errors', 1); - set_error_handler(function ($errno, $errstr, $errfile, $errline) { -- if (error_reporting() === 0) { -+ if (! (error_reporting() & $errno)) { - // Error was suppressed with the @-operator - return false; // Continue with the normal error handler - } -diff --git a/library/Icinga/Test/BaseTestCase.php b/library/Icinga/Test/BaseTestCase.php -index 286ec30591..aea79210fb 100644 ---- library/Icinga/Test/BaseTestCase.php -+++ library/Icinga/Test/BaseTestCase.php -@@ -23,7 +23,6 @@ function mt() - use Exception; - use RuntimeException; - use Mockery; -- use PHPUnit_Framework_TestCase; - use Icinga\Application\Icinga; - use Icinga\Data\ConfigObject; - use Icinga\Data\ResourceFactory; -@@ -32,7 +31,7 @@ function mt() - /** - * Class BaseTestCase - */ -- abstract class BaseTestCase extends PHPUnit_Framework_TestCase implements DbTest -+ abstract class BaseTestCase extends Mockery\Adapter\Phpunit\MockeryTestCase implements DbTest - { - /** - * Path to application/ -@@ -138,7 +137,7 @@ public static function setupDirectories() - /** - * Setup MVC bootstrapping and ensure that the Icinga-Mock gets reinitialized - */ -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - $this->setupIcingaMock(); -@@ -334,6 +333,23 @@ public function setupDbProvider($resource) - $adapter->exec('DROP TABLE ' . $table . ';'); - } - } -+ -+ /** -+ * Add assertMatchesRegularExpression() method for phpunit >= 8.0 < 9.0 for compatibility with PHP 7.2. -+ * -+ * @TODO Remove once PHP 7.2 support is not needed for testing anymore. -+ */ -+ public static function assertMatchesRegularExpression( -+ string $pattern, -+ string $string, -+ string $message = '' -+ ): void { -+ if (method_exists(parent::class, 'assertMatchesRegularExpression')) { -+ parent::assertMatchesRegularExpression($pattern, $string, $message); -+ } else { -+ static::assertRegExp($pattern, $string, $message); -+ } -+ } - } - - BaseTestCase::setupTimezone(); -diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php -index 831df6c818..5d0517884e 100644 ---- modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php -+++ modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php -@@ -96,7 +96,7 @@ protected function joinBaseTables() - array() - ); - -- if (@func_get_arg(0) === false) { -+ if (func_num_args() === 0 || func_get_arg(0) === false) { - $this->select->where( - "hdh.actual_start_time > '1970-01-02 00:00:00'" - ); -diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php -index 6ed081ef70..932d854a01 100644 ---- modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php -+++ modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php -@@ -97,7 +97,7 @@ protected function joinBaseTables() - array() - ); - -- if (@func_get_arg(0) === false) { -+ if (func_num_args() === 0 || func_get_arg(0) === false) { - $this->select->where( - "sdh.actual_start_time > '1970-01-02 00:00:00'" - ); -diff --git a/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php b/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php -index a07614079e..94efee939a 100644 ---- modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php -+++ modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php -@@ -20,7 +20,7 @@ class PluginOutputTest extends BaseTestCase - - protected static $statusTags = array('OK', 'WARNING', 'CRITICAL', 'UNKNOWN', 'UP', 'DOWN'); - -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - -@@ -45,7 +45,7 @@ protected function checkOutput($output, $html, $regexp = false, $isHtml = false) - $html, - preg_quote(self::SUFFIX, '~') - ); -- $this->assertRegExp($expect, $actual, 'Output must match example regexp'); -+ $this->assertMatchesRegularExpression($expect, $actual, 'Output must match example regexp'); - } else { - $expect = $prefix . $html . self::SUFFIX; - $this->assertEquals($expect, $actual, 'Output must match example'); -diff --git a/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php b/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php -index dbccb5c800..ab6ffa9387 100644 ---- modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php -+++ modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php -@@ -8,19 +8,17 @@ - - class PerfdataTest extends BaseTestCase - { -- /** -- * @expectedException \InvalidArgumentException -- */ - public function testWhetherFromStringThrowsExceptionWhenGivenAnEmptyString() - { -+ $this->expectException(\InvalidArgumentException::class); -+ - Perfdata::fromString(''); - } - -- /** -- * @expectedException \InvalidArgumentException -- */ - public function testWhetherFromStringThrowsExceptionWhenGivenAnInvalidString() - { -+ $this->expectException(\InvalidArgumentException::class); -+ - Perfdata::fromString('test'); - } - -diff --git a/modules/monitoring/test/php/library/Monitoring/Web/Rest/RestRequestTest.php b/modules/monitoring/test/php/library/Monitoring/Web/Rest/RestRequestTest.php -index e422ec0766..6e77ffcdde 100644 ---- modules/monitoring/test/php/library/Monitoring/Web/Rest/RestRequestTest.php -+++ modules/monitoring/test/php/library/Monitoring/Web/Rest/RestRequestTest.php -@@ -16,11 +16,10 @@ protected function curlExec(array $options) - - class RestRequestTest extends BaseTestCase - { -- /** -- * @expectedException \Icinga\Exception\Json\JsonDecodeException -- */ - public function testInvalidServerResponseHandling() - { -+ $this->expectException(\Icinga\Exception\Json\JsonDecodeException::class); -+ - MockedRestRequest::get('http://localhost')->send(); - } - } -diff --git a/modules/monitoring/test/php/regression/Bug7043Test.php b/modules/monitoring/test/php/regression/Bug7043Test.php -index 07cc02428f..ba9291be60 100644 ---- modules/monitoring/test/php/regression/Bug7043Test.php -+++ modules/monitoring/test/php/regression/Bug7043Test.php -@@ -24,7 +24,7 @@ public static function setModuleConfig($moduleName, $configName, $config) - - class Bug7043Test extends BaseTestCase - { -- public function tearDown() -+ public function tearDown(): void - { - parent::tearDown(); - Mockery::close(); // Necessary because some tests run in a separate process -diff --git a/modules/setup/application/views/scripts/index/index.phtml b/modules/setup/application/views/scripts/index/index.phtml -index b5fb40798f..3a6e17965f 100644 ---- modules/setup/application/views/scripts/index/index.phtml -+++ modules/setup/application/views/scripts/index/index.phtml -@@ -9,10 +9,10 @@ $currentPos = array_search($wizard->getCurrentPage(), $pages, true); - list($configPagesLeft, $configPagesRight) = array_chunk($configPages, count($configPages) / 2, true); - - $visitedPages = array_keys($wizard->getPageData()); --$maxProgress = @max(array_keys(array_filter( -+$maxProgress = max(array_merge([0], array_keys(array_filter( - $pages, - function ($page) use ($visitedPages) { return in_array($page->getName(), $visitedPages); } --))); -+)))); - - ?> -
-diff --git a/test/php/application/views/helpers/DateFormatTestBroken.php b/test/php/application/views/helpers/DateFormatTestBroken.php -index 188c629888..6fb768b3cd 100644 ---- test/php/application/views/helpers/DateFormatTestBroken.php -+++ test/php/application/views/helpers/DateFormatTestBroken.php -@@ -12,7 +12,7 @@ - - class DateFormatTest extends BaseTestCase - { -- public function tearDown() -+ public function tearDown(): void - { - DateTimeFactory::setConfig(array('timezone' => date_default_timezone_get())); - } -diff --git a/test/php/bootstrap.php b/test/php/bootstrap.php -index 75912674c2..6f78711720 100644 ---- test/php/bootstrap.php -+++ test/php/bootstrap.php -@@ -36,10 +36,6 @@ - - require_once($icingaLibPath . '/Test/ClassLoader.php'); - --if (! class_exists('PHPUnit_Framework_TestCase')) { -- require_once __DIR__ . '/phpunit-compat.php'; --} -- - $loader = new Icinga\Test\ClassLoader(); - $loader->registerNamespace('Tests', $testLibraryPath); - $loader->registerNamespace('Icinga', $icingaLibPath); -diff --git a/test/php/library/Icinga/Application/ClassLoaderTest.php b/test/php/library/Icinga/Application/ClassLoaderTest.php -index 5422869125..7b88c6e74a 100644 ---- test/php/library/Icinga/Application/ClassLoaderTest.php -+++ test/php/library/Icinga/Application/ClassLoaderTest.php -@@ -26,7 +26,7 @@ public function testFlag() - - EOD; - -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - $tempDir = sys_get_temp_dir(); -@@ -35,7 +35,7 @@ public function setUp() - file_put_contents($this->baseDir. self::$classFile, self::$classContent); - } - -- public function tearDown() -+ public function tearDown(): void - { - parent::tearDown(); - system('rm -rf '. $this->baseDir); -diff --git a/test/php/library/Icinga/Application/ConfigTest.php b/test/php/library/Icinga/Application/ConfigTest.php -index e47173679c..5fb47639a6 100644 ---- test/php/library/Icinga/Application/ConfigTest.php -+++ test/php/library/Icinga/Application/ConfigTest.php -@@ -11,7 +11,7 @@ class ConfigTest extends BaseTestCase - /** - * Set up config dir - */ -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - $this->oldConfigDir = Config::$configDir; -@@ -21,7 +21,7 @@ public function setUp() - /** - * Reset config dir - */ -- public function tearDown() -+ public function tearDown(): void - { - parent::tearDown(); - Config::$configDir = $this->oldConfigDir; -@@ -185,11 +185,10 @@ public function testWhetherConfigKnowsWhichSectionsItHas() - ); - } - -- /** -- * @expectedException UnexpectedValueException -- */ - public function testWhetherAnExceptionIsThrownWhenTryingToAccessASectionPropertyOnANonSection() - { -+ $this->expectException(\UnexpectedValueException::class); -+ - $config = Config::fromArray(array('a' => 'b')); - $config->get('a', 'b'); - } -@@ -234,11 +233,10 @@ public function testWhetherItIsPossibleToInitializeAConfigFromAIniFile() - ); - } - -- /** -- * @expectedException Icinga\Exception\NotReadableError -- */ - public function testWhetherFromIniThrowsAnExceptionOnInsufficientPermission() - { -+ $this->expectException(\Icinga\Exception\NotReadableError::class); -+ - Config::fromIni('/etc/shadow'); - } - -diff --git a/test/php/library/Icinga/Application/Hook/AuditHookTest.php b/test/php/library/Icinga/Application/Hook/AuditHookTest.php -index 8f0a12507b..14ca43792c 100644 ---- test/php/library/Icinga/Application/Hook/AuditHookTest.php -+++ test/php/library/Icinga/Application/Hook/AuditHookTest.php -@@ -32,27 +32,24 @@ public function testFormatMessageResolvesParametersWithSingleBraces() - $this->assertEquals('foo', (new TestAuditHook())->formatMessage('{{te{.}st}}', ['te{' => ['}st' => 'foo']])); - } - -- /** -- * @expectedException \InvalidArgumentException -- */ - public function testFormatMessageComplainsAboutUnresolvedParameters() - { -+ $this->expectException(\InvalidArgumentException::class); -+ - (new TestAuditHook())->formatMessage('{{missing}}', []); - } - -- /** -- * @expectedException \InvalidArgumentException -- */ - public function testFormatMessageComplainsAboutNonScalarParameters() - { -+ $this->expectException(\InvalidArgumentException::class); -+ - (new TestAuditHook())->formatMessage('{{test}}', ['test' => ['foo' => 'bar']]); - } - -- /** -- * @expectedException \InvalidArgumentException -- */ - public function testFormatMessageComplainsAboutNonArrayParameters() - { -+ $this->expectException(\InvalidArgumentException::class); -+ - (new TestAuditHook())->formatMessage('{{test.foo}}', ['test' => 'foo']); - } - } -diff --git a/test/php/library/Icinga/Data/ConfigObjectTest.php b/test/php/library/Icinga/Data/ConfigObjectTest.php -index 9b87019bf6..f6b577b034 100644 ---- test/php/library/Icinga/Data/ConfigObjectTest.php -+++ test/php/library/Icinga/Data/ConfigObjectTest.php -@@ -115,11 +115,10 @@ public function testWhetherItIsPossibleToSetPropertiesAndSections() - ); - } - -- /** -- * @expectedException \Icinga\Exception\ProgrammingError -- */ - public function testWhetherItIsNotPossibleToAppendProperties() - { -+ $this->expectException(\Icinga\Exception\ProgrammingError::class); -+ - $config = new ConfigObject(); - $config[] = 'test'; - } -diff --git a/test/php/library/Icinga/Data/DataArray/ArrayDatasourceTest.php b/test/php/library/Icinga/Data/DataArray/ArrayDatasourceTest.php -index 5ad2b1b091..7e715cac2e 100644 ---- test/php/library/Icinga/Data/DataArray/ArrayDatasourceTest.php -+++ test/php/library/Icinga/Data/DataArray/ArrayDatasourceTest.php -@@ -10,7 +10,7 @@ class ArrayDatasourceTest extends BaseTestCase - { - private $sampleData; - -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - $this->sampleData = array( -diff --git a/test/php/library/Icinga/Data/Filter/FilterTest.php b/test/php/library/Icinga/Data/Filter/FilterTest.php -index 97133a2163..9bbff01a32 100644 ---- test/php/library/Icinga/Data/Filter/FilterTest.php -+++ test/php/library/Icinga/Data/Filter/FilterTest.php -@@ -61,7 +61,7 @@ class FilterTest extends BaseTestCase - - private $sampleData; - -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - $this->sampleData = array( -diff --git a/test/php/library/Icinga/File/Ini/IniParserTest.php b/test/php/library/Icinga/File/Ini/IniParserTest.php -index 5a1d7df906..b945cc44e1 100644 ---- test/php/library/Icinga/File/Ini/IniParserTest.php -+++ test/php/library/Icinga/File/Ini/IniParserTest.php -@@ -12,13 +12,13 @@ class IniParserTest extends BaseTestCase - { - protected $tempFile; - -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - $this->tempFile = tempnam(sys_get_temp_dir(), 'icinga-ini-parser-test'); - } - -- public function tearDown() -+ public function tearDown(): void - { - parent::tearDown(); - unlink($this->tempFile); -diff --git a/test/php/library/Icinga/File/Ini/IniWriterTest.php b/test/php/library/Icinga/File/Ini/IniWriterTest.php -index c3fb6df1fc..41e1f13e67 100644 ---- test/php/library/Icinga/File/Ini/IniWriterTest.php -+++ test/php/library/Icinga/File/Ini/IniWriterTest.php -@@ -12,7 +12,7 @@ class IniWriterTest extends BaseTestCase - protected $tempFile; - protected $tempFile2; - -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - -@@ -20,7 +20,7 @@ public function setUp() - $this->tempFile2 = tempnam(sys_get_temp_dir(), 'icinga-ini-writer-test-2'); - } - -- public function tearDown() -+ public function tearDown(): void - { - parent::tearDown(); - -@@ -275,7 +275,7 @@ public function testWhetherLinebreaksAreProcessed() - ); - - $rendered = $writer->render(); -- $this->assertRegExp( -+ $this->assertMatchesRegularExpression( - '~linebreak\\\\nin line~', - $rendered, - 'newlines in values are not escaped' -@@ -322,11 +322,10 @@ public function testSectionNameEscaping() - ); - } - -- /** -- * @expectedException \Icinga\Exception\ConfigurationError -- */ - public function testWhetherBracketsAreIllegalInSectionNames() - { -+ $this->expectException(\Icinga\Exception\ConfigurationError::class); -+ - $config = Config::fromArray(['section [brackets]' => []]); - (new IniWriter($config, $this->tempFile))->write(); - } -@@ -419,7 +418,7 @@ public function testWhetherNullValuesGetPersisted() - $config->setSection('garbage', $section); - - $iniWriter = new IniWriter($config, '/dev/null'); -- $this->assertNotContains( -+ $this->assertStringNotContainsString( - 'foobar', - $iniWriter->render(), - 'IniWriter persists section keys with null values' -@@ -434,7 +433,7 @@ public function testWhetherEmptyValuesGetPersisted() - $config->setSection('garbage', $section); - - $iniWriter = new IniWriter($config, '/dev/null'); -- $this->assertContains( -+ $this->assertStringContainsString( - 'foobar', - $iniWriter->render(), - 'IniWriter doesn\'t persist section keys with empty values' -@@ -451,7 +450,7 @@ public function testExplicitRemove() - $section = $config->getSection('garbage'); - $section->foobar = null; - $iniWriter = new IniWriter($config, $filename); -- $this->assertNotContains( -+ $this->assertStringNotContainsString( - 'foobar', - $iniWriter->render(), - 'IniWriter doesn\'t remove section keys with null values' -diff --git a/test/php/library/Icinga/File/Storage/LocalFileStorageTest.php b/test/php/library/Icinga/File/Storage/LocalFileStorageTest.php -index 5f104a50c4..7ba0efd2f1 100644 ---- test/php/library/Icinga/File/Storage/LocalFileStorageTest.php -+++ test/php/library/Icinga/File/Storage/LocalFileStorageTest.php -@@ -54,11 +54,10 @@ public function testGetIterator() - static::assertSame(array('foobar'), array_values(iterator_to_array($lfs->getIterator()))); - } - -- /** -- * @expectedException \Icinga\Exception\NotReadableError -- */ - public function testGetIteratorThrowsNotReadableError() - { -+ $this->expectException(\Icinga\Exception\NotReadableError::class); -+ - $lfs = new LocalFileStorage('/notreadabledirectory'); - $lfs->getIterator(); - } -@@ -79,21 +78,19 @@ public function testCreate() - static::assertSame('Hello world!', $lfs->read('foo/bar')); - } - -- /** -- * @expectedException \Icinga\Exception\AlreadyExistsException -- */ - public function testCreateThrowsAlreadyExistsException() - { -+ $this->expectException(\Icinga\Exception\AlreadyExistsException::class); -+ - $lfs = new TemporaryLocalFileStorage(); - $lfs->create('foobar', 'Hello world!'); - $lfs->create('foobar', 'Hello world!'); - } - -- /** -- * @expectedException \Icinga\Exception\NotWritableError -- */ - public function testCreateThrowsNotWritableError() - { -+ $this->expectException(\Icinga\Exception\NotWritableError::class); -+ - $lfs = new LocalFileStorage('/notwritabledirectory'); - $lfs->create('foobar', 'Hello world!'); - } -@@ -105,20 +102,18 @@ public function testRead() - static::assertSame('Hello world!', $lfs->read('foobar')); - } - -- /** -- * @expectedException \Icinga\Exception\NotFoundError -- */ - public function testReadThrowsNotFoundError() - { -+ $this->expectException(\Icinga\Exception\NotFoundError::class); -+ - $lfs = new TemporaryLocalFileStorage(); - $lfs->read('foobar'); - } - -- /** -- * @expectedException \Icinga\Exception\NotReadableError -- */ - public function testReadThrowsNotReadableError() - { -+ $this->expectException(\Icinga\Exception\NotReadableError::class); -+ - $lfs = new TemporaryLocalFileStorage(); - $lfs->create('foobar', 'Hello world!'); - chmod($lfs->resolvePath('foobar'), 0); -@@ -133,20 +128,18 @@ public function testUpdate() - static::assertSame('Hello universe!', $lfs->read('foobar')); - } - -- /** -- * @expectedException \Icinga\Exception\NotFoundError -- */ - public function testUpdateThrowsNotFoundError() - { -+ $this->expectException(\Icinga\Exception\NotFoundError::class); -+ - $lfs = new TemporaryLocalFileStorage(); - $lfs->update('foobar', 'Hello universe!'); - } - -- /** -- * @expectedException \Icinga\Exception\NotWritableError -- */ - public function testUpdateThrowsNotWritableError() - { -+ $this->expectException(\Icinga\Exception\NotWritableError::class); -+ - $lfs = new TemporaryLocalFileStorage(); - $lfs->create('foobar', 'Hello world!'); - chmod($lfs->resolvePath('foobar'), 0); -@@ -161,20 +154,18 @@ public function testDelete() - static::assertFalse($lfs->has('foobar')); - } - -- /** -- * @expectedException \Icinga\Exception\NotFoundError -- */ - public function testDeleteThrowsNotFoundError() - { -+ $this->expectException(\Icinga\Exception\NotFoundError::class); -+ - $lfs = new TemporaryLocalFileStorage(); - $lfs->delete('foobar'); - } - -- /** -- * @expectedException \Icinga\Exception\NotWritableError -- */ - public function testDeleteThrowsNotWritableError() - { -+ $this->expectException(\Icinga\Exception\NotWritableError::class); -+ - $lfs = new TemporaryLocalFileStorage(); - $lfs->create('foobar', 'Hello world!'); - -@@ -204,20 +195,18 @@ public function testResolvePathAssertExistence() - $lfs->resolvePath('./notRelevant/../foobar', true); - } - -- /** -- * @expectedException \Icinga\Exception\NotFoundError -- */ - public function testResolvePathThrowsNotFoundError() - { -+ $this->expectException(\Icinga\Exception\NotFoundError::class); -+ - $lfs = new TemporaryLocalFileStorage(); - $lfs->resolvePath('foobar', true); - } - -- /** -- * @expectedException \InvalidArgumentException -- */ - public function testResolvePathThrowsInvalidArgumentException() - { -+ $this->expectException(\InvalidArgumentException::class); -+ - $lfs = new LocalFileStorage('/notreadabledirectory'); - $lfs->resolvePath('../foobar'); - } -diff --git a/test/php/library/Icinga/Logger/Writer/StreamWriterTest.php b/test/php/library/Icinga/Logger/Writer/StreamWriterTest.php -index 38ff4dc0d0..dfd356248a 100644 ---- test/php/library/Icinga/Logger/Writer/StreamWriterTest.php -+++ test/php/library/Icinga/Logger/Writer/StreamWriterTest.php -@@ -10,14 +10,14 @@ - - class StreamWriterTest extends BaseTestCase - { -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - - $this->target = tempnam(sys_get_temp_dir(), 'log'); - } - -- public function tearDown() -+ public function tearDown(): void - { - parent::tearDown(); - -@@ -38,6 +38,6 @@ public function testWhetherStreamWriterWritesMessages() - $writer = new FileWriter(new ConfigObject(array('file' => $this->target))); - $writer->log(Logger::ERROR, 'This is a test error'); - $log = file_get_contents($this->target); -- $this->assertContains('This is a test error', $log, 'StreamWriter does not write log messages'); -+ $this->assertStringContainsString('This is a test error', $log, 'StreamWriter does not write log messages'); - } - } -diff --git a/test/php/library/Icinga/Test/BaseTestCaseTest.php b/test/php/library/Icinga/Test/BaseTestCaseTest.php -index 8611dbe620..5c06ad9662 100644 ---- test/php/library/Icinga/Test/BaseTestCaseTest.php -+++ test/php/library/Icinga/Test/BaseTestCaseTest.php -@@ -10,7 +10,7 @@ class BaseTestCaseTest extends BaseTestCase - { - protected $emptySqlDumpFile; - -- public function tearDown() -+ public function tearDown(): void - { - parent::tearDown(); - -@@ -148,19 +148,17 @@ public function testWhetherSetupDbProviderCleansUpOciAdapter($resource) - $this->assertCount(0, $tables); - } - -- /** -- * @expectedException RuntimeException -- */ - public function testWhetherLoadSqlThrowsErrorWhenFileMissing() - { -+ $this->expectException(\RuntimeException::class); -+ - $this->loadSql(Mockery::mock('Icinga\Data\Db\DbConnection'), 'not_existing'); - } - -- /** -- * @expectedException RuntimeException -- */ - public function testWhetherLoadSqlThrowsErrorWhenFileEmpty() - { -+ $this->expectException(\RuntimeException::class); -+ - $this->emptySqlDumpFile = tempnam(sys_get_temp_dir(), 'icinga2-web-db-test-empty'); - $this->loadSql(Mockery::mock('Icinga\Data\Db\DbConnection'), $this->emptySqlDumpFile); - } -diff --git a/test/php/library/Icinga/User/Store/DbStoreTest.php b/test/php/library/Icinga/User/Store/DbStoreTest.php -index 54855cf60a..1f56f93cbe 100644 ---- test/php/library/Icinga/User/Store/DbStoreTest.php -+++ test/php/library/Icinga/User/Store/DbStoreTest.php -@@ -83,11 +83,10 @@ public function testWhetherPreferenceInsertionWorks() - $this->assertEmpty($dbMock->deletions, 'DbStore::save deletes *new* preferences'); - } - -- /** -- * @expectedException \Icinga\Exception\NotWritableError -- */ - public function testWhetherPreferenceInsertionThrowsNotWritableError() - { -+ $this->expectException(\Icinga\Exception\NotWritableError::class); -+ - $store = $this->getStore(new FaultyDatabaseMock()); - $store->save( - Mockery::mock( -@@ -114,11 +113,10 @@ public function testWhetherPreferenceUpdatesWork() - $this->assertEmpty($dbMock->deletions, 'DbStore::save inserts *existing* preferneces'); - } - -- /** -- * @expectedException \Icinga\Exception\NotWritableError -- */ - public function testWhetherPreferenceUpdatesThrowNotWritableError() - { -+ $this->expectException(\Icinga\Exception\NotWritableError::class); -+ - $store = $this->getStore(new FaultyDatabaseMock()); - $store->setPreferences(array('testsection' => array('key' => 'value'))); - $store->save( -@@ -146,11 +144,10 @@ public function testWhetherPreferenceDeletionWorks() - $this->assertEmpty($dbMock->updates, 'DbStore::save updates *removed* preferences'); - } - -- /** -- * @expectedException \Icinga\Exception\NotWritableError -- */ - public function testWhetherPreferenceDeletionThrowsNotWritableError() - { -+ $this->expectException(\Icinga\Exception\NotWritableError::class); -+ - $store = $this->getStore(new FaultyDatabaseMock()); - $store->setPreferences(array('testsection' => array('key' => 'value'))); - $store->save( -diff --git a/test/php/library/Icinga/UserTest.php b/test/php/library/Icinga/UserTest.php -index 7798aee501..a5f7ebdb1b 100644 ---- test/php/library/Icinga/UserTest.php -+++ test/php/library/Icinga/UserTest.php -@@ -52,11 +52,10 @@ public function testWhetherValidEmailsCanBeSet() - ); - } - -- /** -- * @expectedException \InvalidArgumentException -- */ - public function testWhetherInvalidEmailsCannotBeSet() - { -+ $this->expectException(\InvalidArgumentException::class); -+ - $user = new User('unittest'); - $user->setEmail('mySampleEmail at someDomain dot org'); - } -diff --git a/test/php/library/Icinga/Util/FileTest.php b/test/php/library/Icinga/Util/FileTest.php -index 68074a5d34..d05be2bec6 100644 ---- test/php/library/Icinga/Util/FileTest.php -+++ test/php/library/Icinga/Util/FileTest.php -@@ -8,20 +8,18 @@ - - class FileTest extends BaseTestCase - { -- /** -- * @expectedException \Icinga\Exception\NotWritableError -- */ - public function testWhetherWritingToNonWritableFilesThrowsAnException() - { -+ $this->expectException(\Icinga\Exception\NotWritableError::class); -+ - $file = new File('/dev/null'); - $file->fwrite('test'); - } - -- /** -- * @expectedException \Icinga\Exception\NotWritableError -- */ - public function testWhetherTruncatingNonWritableFilesThrowsAnException() - { -+ $this->expectException(\Icinga\Exception\NotWritableError::class); -+ - $file = new File('/dev/null'); - $file->ftruncate(0); - } -diff --git a/test/php/library/Icinga/Util/TranslatorTest.php b/test/php/library/Icinga/Util/TranslatorTest.php -index d61ea4a9da..1ebb7b4141 100644 ---- test/php/library/Icinga/Util/TranslatorTest.php -+++ test/php/library/Icinga/Util/TranslatorTest.php -@@ -17,7 +17,7 @@ public static function getAvailableLocaleCodes() - - class TranslatorTest extends BaseTestCase - { -- public function setUp() -+ public function setUp(): void - { - parent::setUp(); - Translator::registerDomain('icingatest', BaseTestCase::$testDir . '/res/locale'); -@@ -48,11 +48,10 @@ public function testWhetherSetupLocaleSetsUpTheGivenLocale() - ); - } - -- /** -- * @expectedException Icinga\Exception\IcingaException -- */ - public function testWhetherSetupLocaleThrowsAnExceptionWhenGivenAnInvalidLocale() - { -+ $this->expectException(\Icinga\Exception\IcingaException::class); -+ - Translator::setupLocale('foobar'); - } - -diff --git a/test/php/library/Icinga/Web/FormTest.php b/test/php/library/Icinga/Web/FormTest.php -index 3d6ac7d1e9..b43efe452d 100644 *** 1588 LINES SKIPPED ***