Skip to content

Commit ba2a943

Browse files
Merge branch '10.5' into 11.1
2 parents 8661cec + 1e4641d commit ba2a943

File tree

7 files changed

+12
-38
lines changed

7 files changed

+12
-38
lines changed

.psalm/baseline.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,8 @@
720720
<code><![CDATA[logEventsVerboseText]]></code>
721721
<code><![CDATA[logEventsVerboseText]]></code>
722722
<code><![CDATA[logfileJunit]]></code>
723+
<code><![CDATA[logfileJunit]]></code>
724+
<code><![CDATA[logfileTeamcity]]></code>
723725
<code><![CDATA[logfileTeamcity]]></code>
724726
<code><![CDATA[process]]></code>
725727
<code><![CDATA[process]]></code>

src/Runner/Exception/DirectoryCannotBeCreatedException.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/TextUI/Exception/DirectoryDoesNotExistException.php renamed to src/Runner/Exception/DirectoryDoesNotExistException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
namespace PHPUnit\TextUI;
10+
namespace PHPUnit\Runner;
1111

1212
use function sprintf;
1313
use RuntimeException;

src/Runner/ResultCache/DefaultResultCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use function json_decode;
2222
use function json_encode;
2323
use PHPUnit\Framework\TestStatus\TestStatus;
24-
use PHPUnit\Runner\DirectoryCannotBeCreatedException;
24+
use PHPUnit\Runner\DirectoryDoesNotExistException;
2525
use PHPUnit\Runner\Exception;
2626
use PHPUnit\Util\Filesystem;
2727

@@ -130,7 +130,7 @@ public function load(): void
130130
public function persist(): void
131131
{
132132
if (!Filesystem::createDirectory(dirname($this->cacheFilename))) {
133-
throw new DirectoryCannotBeCreatedException($this->cacheFilename);
133+
throw new DirectoryDoesNotExistException(dirname($this->cacheFilename));
134134
}
135135

136136
$data = [

src/TextUI/Application.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
use PHPUnit\Runner\Baseline\Writer;
4040
use PHPUnit\Runner\CodeCoverage;
4141
use PHPUnit\Runner\DeprecationCollector\Facade as DeprecationCollector;
42+
use PHPUnit\Runner\DirectoryDoesNotExistException;
4243
use PHPUnit\Runner\ErrorHandler;
4344
use PHPUnit\Runner\Extension\ExtensionBootstrapper;
4445
use PHPUnit\Runner\Extension\Facade as ExtensionFacade;
@@ -217,7 +218,7 @@ public function run(array $argv): int
217218
OutputFacade::printerFor($configuration->logfileTestdoxHtml())->print(
218219
(new TestDoxHtmlRenderer)->render($testDoxResult),
219220
);
220-
} catch (Exception $e) {
221+
} catch (DirectoryDoesNotExistException|InvalidSocketException $e) {
221222
EventFacade::emitter()->testRunnerTriggeredWarning(
222223
sprintf(
223224
'Cannot log test results in TestDox HTML format to "%s": %s',
@@ -234,7 +235,7 @@ public function run(array $argv): int
234235
OutputFacade::printerFor($configuration->logfileTestdoxText())->print(
235236
(new TestDoxTextRenderer)->render($testDoxResult),
236237
);
237-
} catch (Exception $e) {
238+
} catch (DirectoryDoesNotExistException|InvalidSocketException $e) {
238239
EventFacade::emitter()->testRunnerTriggeredWarning(
239240
sprintf(
240241
'Cannot log test results in TestDox plain text format to "%s": %s',
@@ -590,7 +591,7 @@ private function registerLogfileWriters(Configuration $configuration): void
590591
OutputFacade::printerFor($configuration->logfileJunit()),
591592
EventFacade::instance(),
592593
);
593-
} catch (Exception $e) {
594+
} catch (DirectoryDoesNotExistException|InvalidSocketException $e) {
594595
EventFacade::emitter()->testRunnerTriggeredWarning(
595596
sprintf(
596597
'Cannot log test results in JUnit XML format to "%s": %s',
@@ -609,7 +610,7 @@ private function registerLogfileWriters(Configuration $configuration): void
609610
),
610611
EventFacade::instance(),
611612
);
612-
} catch (Exception $e) {
613+
} catch (DirectoryDoesNotExistException|InvalidSocketException $e) {
613614
EventFacade::emitter()->testRunnerTriggeredWarning(
614615
sprintf(
615616
'Cannot log test results in TeamCity format to "%s": %s',

src/TextUI/Output/Facade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
use PHPUnit\Event\UnknownSubscriberTypeException;
1616
use PHPUnit\Logging\TeamCity\TeamCityLogger;
1717
use PHPUnit\Logging\TestDox\TestResultCollection;
18+
use PHPUnit\Runner\DirectoryDoesNotExistException;
1819
use PHPUnit\TestRunner\TestResult\TestResult;
1920
use PHPUnit\TextUI\Configuration\Configuration;
20-
use PHPUnit\TextUI\DirectoryDoesNotExistException;
2121
use PHPUnit\TextUI\InvalidSocketException;
2222
use PHPUnit\TextUI\Output\Default\ProgressPrinter\ProgressPrinter as DefaultProgressPrinter;
2323
use PHPUnit\TextUI\Output\Default\ResultPrinter as DefaultResultPrinter;

src/TextUI/Output/Printer/DefaultPrinter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use function fwrite;
2020
use function str_replace;
2121
use function str_starts_with;
22-
use PHPUnit\TextUI\DirectoryDoesNotExistException;
22+
use PHPUnit\Runner\DirectoryDoesNotExistException;
2323
use PHPUnit\TextUI\InvalidSocketException;
2424
use PHPUnit\Util\Filesystem;
2525

0 commit comments

Comments
 (0)