Skip to content

Commit

Permalink
[8.x] Ignore skipped tests (#42585)
Browse files Browse the repository at this point in the history
* Ignore skipped tests

* wip
  • Loading branch information
driesvints committed Jun 2, 2022
1 parent 45f4676 commit 51efb37
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
printerClass="Illuminate\Tests\IgnoreSkippedPrinter"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
Expand Down
26 changes: 26 additions & 0 deletions tests/IgnoreSkippedPrinter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Illuminate\Tests;

use PHPUnit\Framework\TestResult;
use PHPUnit\Runner\Version;
use PHPUnit\TextUI\DefaultResultPrinter as PHPUnit9ResultPrinter;
use PHPUnit\TextUI\ResultPrinter as PHPUnit8ResultPrinter;

if (class_exists(Version::class) && (int) Version::series()[0] >= 9) {
class IgnoreSkippedPrinter extends PHPUnit9ResultPrinter
{
protected function printSkipped(TestResult $result): void
{
//
}
}
} else {
class IgnoreSkippedPrinter extends PHPUnit8ResultPrinter
{
protected function printSkipped(TestResult $result): void
{
//
}
}
}

0 comments on commit 51efb37

Please sign in to comment.