diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 953430e..ca6222b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,15 +32,13 @@ jobs: - name: Run test suite run: | - mkdir -p ./coverage/php-${{ matrix.php-version }} - ./vendor/bin/phpunit --configuration ./phpunit-${{ matrix.php-version }}.xml --coverage-clover ./coverage/php-${{ matrix.php-version }}/coverage.clover --coverage-html ./coverage/php-${{ matrix.php-version }}/html/ - - - name: Get current date/time - id: date - run: echo "::set-output name=date::$(date +'%Y%m%d-%H%M')" + mkdir ./coverage + php -v > ./coverage/php${{ matrix.php-version }}_output.txt && echo '' >> ./coverage/php${{ matrix.php-version }}_output.txt + ./vendor/bin/phpunit --configuration ./tests/phpunit-${{ matrix.php-version }}.xml --coverage-clover ./coverage/php${{ matrix.php-version }}_coverage.clover >> ./coverage/php${{ matrix.php-version }}_output.txt + cat ./coverage/php${{ matrix.php-version }}_output.txt - name: Save coverage results uses: actions/upload-artifact@v3 with: - name: coverage_php-array-to-xml_${{ steps.date.outputs.date }} + name: coverage_clover_php-array-to-xml path: ./coverage diff --git a/README.md b/README.md index 0a19679..02b9793 100644 --- a/README.md +++ b/README.md @@ -456,3 +456,15 @@ Result (prettified): __NULL__ ``` + +# PHPUnit Tests +Use a specific configuration file, depending on your php version: +``` +./vendor/bin/phpunit --configuration ./tests/phpunit-7.0.xml +./vendor/bin/phpunit --configuration ./tests/phpunit-7.1.xml +./vendor/bin/phpunit --configuration ./tests/phpunit-7.2.xml +./vendor/bin/phpunit --configuration ./tests/phpunit-7.3.xml +./vendor/bin/phpunit --configuration ./tests/phpunit-7.4.xml +./vendor/bin/phpunit --configuration ./tests/phpunit-8.0.xml +./vendor/bin/phpunit --configuration ./tests/phpunit-8.1.xml +``` diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index 528ae91..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ./src - - - ./vendor - ./tests - - - - - ./tests/ - - - diff --git a/phpunit-7.0.xml b/tests/phpunit-7.0.xml similarity index 75% rename from phpunit-7.0.xml rename to tests/phpunit-7.0.xml index 81cca98..1cfd691 100644 --- a/phpunit-7.0.xml +++ b/tests/phpunit-7.0.xml @@ -2,7 +2,7 @@ - - ./src + ./../src - ./vendor - ./tests + ./../vendor + ./../tests - - ./tests/ + ./../tests/ - \ No newline at end of file diff --git a/phpunit-7.1.xml b/tests/phpunit-7.1.xml similarity index 74% rename from phpunit-7.1.xml rename to tests/phpunit-7.1.xml index b775b6c..2f0f1a2 100644 --- a/phpunit-7.1.xml +++ b/tests/phpunit-7.1.xml @@ -2,28 +2,25 @@ - - ./src + ./../src - ./vendor - ./tests + ./../vendor + ./../tests - - ./tests/ + ./../tests/ - \ No newline at end of file diff --git a/phpunit-7.2.xml b/tests/phpunit-7.2.xml similarity index 74% rename from phpunit-7.2.xml rename to tests/phpunit-7.2.xml index 281b609..d42256d 100644 --- a/phpunit-7.2.xml +++ b/tests/phpunit-7.2.xml @@ -2,28 +2,25 @@ - - ./src + ./../src - ./vendor - ./tests + ./../vendor + ./../tests - - ./tests/ + ./../tests/ - \ No newline at end of file diff --git a/phpunit-7.3.xml b/tests/phpunit-7.3.xml similarity index 78% rename from phpunit-7.3.xml rename to tests/phpunit-7.3.xml index 528ae91..299ec13 100644 --- a/phpunit-7.3.xml +++ b/tests/phpunit-7.3.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" - bootstrap="vendor/autoload.php" + bootstrap="./../vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" @@ -15,16 +15,16 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> - ./src + ./../src - ./vendor - ./tests + ./../vendor + ./../tests - ./tests/ + ./../tests/ diff --git a/phpunit-7.4.xml b/tests/phpunit-7.4.xml similarity index 78% rename from phpunit-7.4.xml rename to tests/phpunit-7.4.xml index 528ae91..299ec13 100644 --- a/phpunit-7.4.xml +++ b/tests/phpunit-7.4.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" - bootstrap="vendor/autoload.php" + bootstrap="./../vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" @@ -15,16 +15,16 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> - ./src + ./../src - ./vendor - ./tests + ./../vendor + ./../tests - ./tests/ + ./../tests/ diff --git a/phpunit-8.0.xml b/tests/phpunit-8.0.xml similarity index 78% rename from phpunit-8.0.xml rename to tests/phpunit-8.0.xml index 528ae91..299ec13 100644 --- a/phpunit-8.0.xml +++ b/tests/phpunit-8.0.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" - bootstrap="vendor/autoload.php" + bootstrap="./../vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" @@ -15,16 +15,16 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> - ./src + ./../src - ./vendor - ./tests + ./../vendor + ./../tests - ./tests/ + ./../tests/ diff --git a/phpunit-8.1.xml b/tests/phpunit-8.1.xml similarity index 78% rename from phpunit-8.1.xml rename to tests/phpunit-8.1.xml index 528ae91..299ec13 100644 --- a/phpunit-8.1.xml +++ b/tests/phpunit-8.1.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" - bootstrap="vendor/autoload.php" + bootstrap="./../vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" @@ -15,16 +15,16 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> - ./src + ./../src - ./vendor - ./tests + ./../vendor + ./../tests - ./tests/ + ./../tests/