Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2021-08-17 10:58:59 +0300
committerGitHub <noreply@github.com>2021-08-17 10:58:59 +0300
commit0829d6e6ac487bf47e4197123d6683b271db8266 (patch)
tree77f8edd0c326b29c50d9fefd174cd45d5ebcbc92 /tests/PHPUnit/Framework
parent8c7fa7d8d414b5201c36661fb4828d14e4c33c53 (diff)
Run AllTests on PHP8 (#16897)
* Run AllTests on PHP8 * use newer phpunit for tests on PHP8 * fix notices/errors * handle trace of phpunit 9 * ensure to compare same types for range check * adjust expected result for php8 * try handling hasDependencies does not exist in PHPUnit 9 * fix: ArgumentCountError: mysqli_stmt::bind_param() does not accept unknown named parameters * Fix usercountry tests * remove incorrect date check * fix expected exception message * fix referrers api test for php8 * add test hint * try to fix session related tests * debug test failure * try to fix mail tests * fix filterUser method * exlucde phpunit from build size calculation * fix scheduled reports test * update release checklist test * unset climode * improves some tests
Diffstat (limited to 'tests/PHPUnit/Framework')
-rw-r--r--tests/PHPUnit/Framework/TestCase/SystemTestCase.php9
-rw-r--r--tests/PHPUnit/Framework/TestRequest/Response.php3
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
index 8a3f929188..2fd52b615f 100644
--- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
@@ -840,6 +840,15 @@ abstract class SystemTestCase extends TestCase
{
return array();
}
+
+ public function hasDependencies(): bool
+ {
+ if (method_exists($this, 'requires')) {
+ return count($this->requires()) > 0;
+ }
+
+ return parent::hasDependencies();
+ }
}
SystemTestCase::$fixture = new \Piwik\Tests\Framework\Fixture();
diff --git a/tests/PHPUnit/Framework/TestRequest/Response.php b/tests/PHPUnit/Framework/TestRequest/Response.php
index 6d224d30a2..c173ef5237 100644
--- a/tests/PHPUnit/Framework/TestRequest/Response.php
+++ b/tests/PHPUnit/Framework/TestRequest/Response.php
@@ -12,7 +12,6 @@ use Piwik\API\Request;
use PHPUnit\Framework\Assert as Asserts;
use Exception;
use Piwik\Tests\Framework\Fixture;
-use Piwik\Tests\Framework\TestCase\SystemTestCase;
/**
* Utility class used to obtain and process API responses for API tests.
@@ -235,7 +234,7 @@ class Response
// check we didn't delete the whole string
if ($testNotSmallAfter && $input != $oldInput) {
- Asserts::assertTrue(strlen($input) > 100);
+ Asserts::assertTrue(strlen($input) > 100, "Removing element $xmlElement from request " . http_build_query($this->requestUrl) . " resulted in a too small value:\n$input");
}
return $input;
}