laracoft's avatar

Capture the output of `artisan test`

Is there a way to capture the output of artisan test to a file? I tried to specify in my phpunit.xml

    <logging>
        <text outputFile="phpunit.txt"/>
    </logging>

But it only caught the following instead of the test names and results (by nuno) in detail.

...............................................................  63 / 100 ( 63%)
.....................................                           100 / 100 (100%)
- PHP version: 8.1.9
- Laravel version: 8.83.23
- PHPUnit version: 9.5.23
0 likes
4 replies
tykus's avatar

Try using the --testdox option

laracoft's avatar

@tykus

sorry did not add my Laravel version, let me check --testdox

laracoft's avatar

@tykus

I'm on PHPUnit 9.5.23 and both below did not work, output is still only dots

<phpunit printerClass="NunoMaduro\Collision\Adapters\Phpunit\Printer" ...
<phpunit testdox="true" ...
laracoft's avatar
laracoft
OP
Best Answer
Level 27

This solved it.

    <logging>
        <testdoxText outputFile="phpunit.txt"/>
    </logging>

Please or to participate in this conversation.