diff options
Diffstat (limited to 'tests/PHPUnit/Framework')
-rw-r--r-- | tests/PHPUnit/Framework/TestCase/SystemTestCase.php | 9 | ||||
-rw-r--r-- | tests/PHPUnit/Framework/TestRequest/Response.php | 3 |
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; } |