Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
17 changes: 17 additions & 0 deletions tests/RecordingOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace StageRightLabs\CommandLineLogger\Tests;

use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Output\ConsoleOutput;

/**
Expand All @@ -17,6 +18,22 @@ final class RecordingOutput extends ConsoleOutput
*/
private string $buffer = '';

/**
* ConsoleOutput auto-detects decoration from the real STDOUT of the
* process running the tests when $decorated is left null, so
* assertions on the recorded output would otherwise pass or fail
* depending on whether the test suite happens to run attached to a
* terminal. Default it to false so the buffer content is
* deterministic; callers can still opt into decorated output.
*/
public function __construct(
int $verbosity = self::VERBOSITY_NORMAL,
bool $decorated = false,
?OutputFormatterInterface $formatter = null,
) {
parent::__construct($verbosity, $decorated, $formatter);
}

/**
* Capture written messages rather than sending them to the terminal.
*/
Expand Down
Loading