From 500fa5431dd563d03724e45e8f78d56962579460 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 16 Oct 2023 10:16:22 +0200 Subject: [PATCH] Fix unit tests on PHP 8.3 Signed-off-by: Joas Schilling --- .../tests/Controller/ExternalShareControllerTest.php | 3 +++ autotest.sh | 4 ++-- tests/phpunit-autotest.xml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/files_sharing/tests/Controller/ExternalShareControllerTest.php b/apps/files_sharing/tests/Controller/ExternalShareControllerTest.php index 11c9c21eb5c..ff6001e0ced 100644 --- a/apps/files_sharing/tests/Controller/ExternalShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ExternalShareControllerTest.php @@ -32,6 +32,7 @@ use OCP\IRequest; use OCP\Http\Client\IResponse; use OCP\Http\Client\IClient; use OCA\Files_Sharing\External\Manager; +use PHPUnit\Framework\MockObject\MockObject; /** * Class ExternalShareControllerTest @@ -43,6 +44,8 @@ class ExternalShareControllerTest extends \Test\TestCase { private $request; /** @var \OCA\Files_Sharing\External\Manager */ private $externalManager; + /** @var IConfig|MockObject */ + private $config; /** @var IClientService */ private $clientService; diff --git a/autotest.sh b/autotest.sh index 6f82b42283c..aa44a7a3efb 100755 --- a/autotest.sh +++ b/autotest.sh @@ -401,8 +401,8 @@ function execute_tests { echo "No coverage" fi - echo "$PHPUNIT" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3" - "$PHPUNIT" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3" + echo "$PHPUNIT" --colors=always --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3" + "$PHPUNIT" --colors=always --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3" RESULT=$? if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then diff --git a/tests/phpunit-autotest.xml b/tests/phpunit-autotest.xml index 1b2729323e6..e966dce402a 100644 --- a/tests/phpunit-autotest.xml +++ b/tests/phpunit-autotest.xml @@ -8,7 +8,7 @@ timeoutForLargeTests="900" convertDeprecationsToExceptions="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"> - + lib/ Core/ Test/