From ec2cbd24018f59d1622ad1f05e130e475015b310 Mon Sep 17 00:00:00 2001 From: Ollie Date: Wed, 10 Jun 2026 10:14:07 +0100 Subject: [PATCH] tests: prevent output in phpunit tests * Modify `ElasticSearchIndexDeleteTest` so it doesn't print output. * `beStrictAboutOutputDuringTests` marks tests as "risky" if there is output printed. * `failOnRisky` makes the test suite fail if any tests are marked as "risky". Bug: T428716 --- phpunit.xml | 2 +- tests/Jobs/Integration/ElasticSearchIndexDeleteTest.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 867f2ff2b..a7b442fae 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,5 @@ - + ./tests diff --git a/tests/Jobs/Integration/ElasticSearchIndexDeleteTest.php b/tests/Jobs/Integration/ElasticSearchIndexDeleteTest.php index 1578bb22f..d196cf7cf 100644 --- a/tests/Jobs/Integration/ElasticSearchIndexDeleteTest.php +++ b/tests/Jobs/Integration/ElasticSearchIndexDeleteTest.php @@ -48,12 +48,11 @@ public function makeRequest($url, $method = 'GET') { ); $response = $curlRequest->execute(); $err = $curlRequest->error(); - var_dump($response); + $curlRequest->close(); if ($err) { - var_dump($err); + $this->fail("Request returned an error: {$err}"); } - $curlRequest->close(); return json_decode($response, true); }