diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cc5d73d36..dde07ec4f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -109,7 +109,7 @@ jobs: run: composer update --no-ansi --no-interaction --no-progress --no-suggest - name: "Run tests with phpunit" - run: php vendor/bin/phpunit --configuration=phpunit.xml + run: php vendor/bin/phpunit --configuration=phpunit.xml.dist - name: "Send code coverage report to Codecov.io" uses: codecov/codecov-action@v3 diff --git a/.gitignore b/.gitignore index 964d223f3..4c2204ce2 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ docs/* vendor/* composer.lock +phpunit.xml diff --git a/phpunit.xml b/phpunit.xml.dist similarity index 84% rename from phpunit.xml rename to phpunit.xml.dist index 1fea31626..848e0a1c2 100644 --- a/phpunit.xml +++ b/phpunit.xml.dist @@ -23,4 +23,8 @@ + + + + diff --git a/tests/Data/QRMatrixTest.php b/tests/Data/QRMatrixTest.php index 54e2f4a85..47e707ea3 100755 --- a/tests/Data/QRMatrixTest.php +++ b/tests/Data/QRMatrixTest.php @@ -17,6 +17,7 @@ use chillerlan\QRCode\Output\{QROutputInterface, QRString}; use PHPUnit\Framework\TestCase; use PHPUnit\Util\Color; use Generator; +use function defined; /** * Tests the QRMatix class @@ -41,6 +42,11 @@ final class QRMatrixTest extends TestCase{ * Matrix debugging console output */ public static function debugMatrix(QRMatrix $matrix):void{ + + if(defined('TEST_IS_CI') && TEST_IS_CI === true){ + return; + } + $opt = new QROptions; $opt->outputType = QROutputInterface::STRING_TEXT; $opt->eol = Color::colorize('reset', "\x00\n"); diff --git a/tests/QRCodeReaderTestAbstract.php b/tests/QRCodeReaderTestAbstract.php index e998c2338..42f8af434 100644 --- a/tests/QRCodeReaderTestAbstract.php +++ b/tests/QRCodeReaderTestAbstract.php @@ -12,6 +12,7 @@ namespace chillerlan\QRCodeTest; +use chillerlan\QRCodeTest\Data\QRMatrixTest; use chillerlan\QRCode\{QRCode, QROptions}; use chillerlan\QRCode\Common\{EccLevel, Mode, Version}; use chillerlan\QRCode\Output\QROutputInterface; @@ -79,8 +80,11 @@ abstract class QRCodeReaderTestAbstract extends TestCase{ } /** @noinspection PhpUndefinedMethodInspection */ - $this::assertSame($expected, (string)(new QRCode) - ->readFromSource($this->FQN::fromFile(__DIR__.'/samples/'.$img, $this->options))); + $result = (new QRCode)->readFromSource($this->FQN::fromFile(__DIR__.'/samples/'.$img, $this->options)); + + QRMatrixTest::debugMatrix($result->getMatrix()); + + $this::assertSame($expected, (string)$result); } public function testReaderMultiSegment():void{