mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-09-05 23:18:20 +00:00
:octocat: mute debug output on CI
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -15,3 +15,4 @@
|
||||
docs/*
|
||||
vendor/*
|
||||
composer.lock
|
||||
phpunit.xml
|
||||
|
||||
@@ -23,4 +23,8 @@
|
||||
<logging>
|
||||
<junit outputFile=".build/logs/junit.xml"/>
|
||||
</logging>
|
||||
<php>
|
||||
<!-- whether the test runs on CI or not - set to false to allow debug output -->
|
||||
<const name="TEST_IS_CI" value="true"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
@@ -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");
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user