Skip to content

Commit

Permalink
Merge branch '11.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed May 3, 2024
2 parents daa61f6 + ba2a943 commit 486935e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .psalm/baseline.xml
Expand Up @@ -736,6 +736,8 @@
<code><![CDATA[logEventsVerboseText]]></code>
<code><![CDATA[logEventsVerboseText]]></code>
<code><![CDATA[logfileJunit]]></code>
<code><![CDATA[logfileJunit]]></code>
<code><![CDATA[logfileTeamcity]]></code>
<code><![CDATA[logfileTeamcity]]></code>
<code><![CDATA[process]]></code>
<code><![CDATA[process]]></code>
Expand Down
29 changes: 0 additions & 29 deletions src/Runner/Exception/DirectoryCannotBeCreatedException.php

This file was deleted.

Expand Up @@ -7,7 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI;
namespace PHPUnit\Runner;

use function sprintf;
use RuntimeException;
Expand Down
4 changes: 2 additions & 2 deletions src/Runner/ResultCache/DefaultResultCache.php
Expand Up @@ -21,7 +21,7 @@
use function json_decode;
use function json_encode;
use PHPUnit\Framework\TestStatus\TestStatus;
use PHPUnit\Runner\DirectoryCannotBeCreatedException;
use PHPUnit\Runner\DirectoryDoesNotExistException;
use PHPUnit\Runner\Exception;
use PHPUnit\Util\Filesystem;

Expand Down Expand Up @@ -130,7 +130,7 @@ public function load(): void
public function persist(): void
{
if (!Filesystem::createDirectory(dirname($this->cacheFilename))) {
throw new DirectoryCannotBeCreatedException($this->cacheFilename);
throw new DirectoryDoesNotExistException(dirname($this->cacheFilename));
}

$data = [
Expand Down
9 changes: 5 additions & 4 deletions src/TextUI/Application.php
Expand Up @@ -39,6 +39,7 @@
use PHPUnit\Runner\Baseline\Writer;
use PHPUnit\Runner\CodeCoverage;
use PHPUnit\Runner\DeprecationCollector\Facade as DeprecationCollector;
use PHPUnit\Runner\DirectoryDoesNotExistException;
use PHPUnit\Runner\ErrorHandler;
use PHPUnit\Runner\Extension\ExtensionBootstrapper;
use PHPUnit\Runner\Extension\Facade as ExtensionFacade;
Expand Down Expand Up @@ -217,7 +218,7 @@ public function run(array $argv): int
OutputFacade::printerFor($configuration->logfileTestdoxHtml())->print(
(new TestDoxHtmlRenderer)->render($testDoxResult),
);
} catch (Exception $e) {
} catch (DirectoryDoesNotExistException|InvalidSocketException $e) {
EventFacade::emitter()->testRunnerTriggeredWarning(
sprintf(
'Cannot log test results in TestDox HTML format to "%s": %s',
Expand All @@ -234,7 +235,7 @@ public function run(array $argv): int
OutputFacade::printerFor($configuration->logfileTestdoxText())->print(
(new TestDoxTextRenderer)->render($testDoxResult),
);
} catch (Exception $e) {
} catch (DirectoryDoesNotExistException|InvalidSocketException $e) {
EventFacade::emitter()->testRunnerTriggeredWarning(
sprintf(
'Cannot log test results in TestDox plain text format to "%s": %s',
Expand Down Expand Up @@ -590,7 +591,7 @@ private function registerLogfileWriters(Configuration $configuration): void
OutputFacade::printerFor($configuration->logfileJunit()),
EventFacade::instance(),
);
} catch (Exception $e) {
} catch (DirectoryDoesNotExistException|InvalidSocketException $e) {
EventFacade::emitter()->testRunnerTriggeredWarning(
sprintf(
'Cannot log test results in JUnit XML format to "%s": %s',
Expand All @@ -609,7 +610,7 @@ private function registerLogfileWriters(Configuration $configuration): void
),
EventFacade::instance(),
);
} catch (Exception $e) {
} catch (DirectoryDoesNotExistException|InvalidSocketException $e) {
EventFacade::emitter()->testRunnerTriggeredWarning(
sprintf(
'Cannot log test results in TeamCity format to "%s": %s',
Expand Down
2 changes: 1 addition & 1 deletion src/TextUI/Output/Facade.php
Expand Up @@ -15,9 +15,9 @@
use PHPUnit\Event\UnknownSubscriberTypeException;
use PHPUnit\Logging\TeamCity\TeamCityLogger;
use PHPUnit\Logging\TestDox\TestResultCollection;
use PHPUnit\Runner\DirectoryDoesNotExistException;
use PHPUnit\TestRunner\TestResult\TestResult;
use PHPUnit\TextUI\Configuration\Configuration;
use PHPUnit\TextUI\DirectoryDoesNotExistException;
use PHPUnit\TextUI\InvalidSocketException;
use PHPUnit\TextUI\Output\Default\ProgressPrinter\ProgressPrinter as DefaultProgressPrinter;
use PHPUnit\TextUI\Output\Default\ResultPrinter as DefaultResultPrinter;
Expand Down
2 changes: 1 addition & 1 deletion src/TextUI/Output/Printer/DefaultPrinter.php
Expand Up @@ -19,7 +19,7 @@
use function fwrite;
use function str_replace;
use function str_starts_with;
use PHPUnit\TextUI\DirectoryDoesNotExistException;
use PHPUnit\Runner\DirectoryDoesNotExistException;
use PHPUnit\TextUI\InvalidSocketException;
use PHPUnit\Util\Filesystem;

Expand Down

0 comments on commit 486935e

Please sign in to comment.