R
R
Romi2022-03-16 16:27:26
PHPUnit
Romi, 2022-03-16 16:27:26

Where can I get a valid phpunit.xml for phpunit 8.5 (in the context of Laravel)?

PHPUnit::assertArraySubset is missing in phpunit 9 (deprecated), but I need it for testing in Laravel.

I removed 9 and installed phpunit 8 - it started, but now it swears at the config (Element 'coverage': This element is not expected) - apparently this is some kind of new feature from version 9.

There is no time or desire to delve into the intricacies of the config, there is such a solid sheet hanging in the docks with options, hence the question:

- Where can I get a suitable phpunit.xml for phpunit 8?

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Romi, 2022-03-16
@romicohen

The question is removed - I found one in one of the related projects I'm working on - there was just the old version of phpunit there: D Just in case - the code, you never know who else wants to:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="vendor/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>

        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
        </whitelist>
    </filter>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="BCRYPT_ROUNDS" value="4"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="MAIL_DRIVER" value="array"/>
        <env name="QUEUE_CONNECTION" value="sync"/>
        <env name="SESSION_DRIVER" value="array"/>
    </php>
</phpunit>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question