Skip to content

Move phpunit files #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 11, 2022
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
12 changes: 5 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,3 +456,15 @@ Result (prettified):
<RealNull>__NULL__</RealNull>
</root>
```

# 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
```
30 changes: 0 additions & 30 deletions phpunit.xml

This file was deleted.

13 changes: 5 additions & 8 deletions phpunit-7.0.xml → tests/phpunit-7.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,26 @@
<!-- PHPUnit 6 PHP 7.0 - PHP 7.2 (https://phpunit.de/supported-versions.html) -->
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
bootstrap="./../vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">

<filter>
<whitelist>
<directory>./src</directory>
<directory>./../src</directory>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
<directory>./../vendor</directory>
<directory>./../tests</directory>
</exclude>
</whitelist>
</filter>

<testsuites>
<testsuite name="PhpArrayToXml Test Suite">
<directory>./tests/</directory>
<directory>./../tests/</directory>
</testsuite>
</testsuites>

</phpunit>
13 changes: 5 additions & 8 deletions phpunit-7.1.xml → tests/phpunit-7.1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@
<!-- PHPUnit 7 PHP 7.1 - PHP 7.3 (https://phpunit.de/supported-versions.html) -->
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
bootstrap="./../vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">

<filter>
<whitelist>
<directory>./src</directory>
<directory>./../src</directory>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
<directory>./../vendor</directory>
<directory>./../tests</directory>
</exclude>
</whitelist>
</filter>

<testsuites>
<testsuite name="PhpArrayToXml Test Suite">
<directory>./tests/</directory>
<directory>./../tests/</directory>
</testsuite>
</testsuites>

</phpunit>
13 changes: 5 additions & 8 deletions phpunit-7.2.xml → tests/phpunit-7.2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@
<!-- PHPUnit 8 >= PHP 7.2 (https://phpunit.de/supported-versions.html) -->
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
bootstrap="./../vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">

<filter>
<whitelist>
<directory>./src</directory>
<directory>./../src</directory>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
<directory>./../vendor</directory>
<directory>./../tests</directory>
</exclude>
</whitelist>
</filter>

<testsuites>
<testsuite name="PhpArrayToXml Test Suite">
<directory>./tests/</directory>
<directory>./../tests/</directory>
</testsuite>
</testsuites>

</phpunit>
10 changes: 5 additions & 5 deletions phpunit-7.3.xml → tests/phpunit-7.3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -15,16 +15,16 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./src</directory>
<directory>./../src</directory>
</include>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
<directory>./../vendor</directory>
<directory>./../tests</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="PhpArrayToXml Test Suite">
<directory>./tests/</directory>
<directory>./../tests/</directory>
</testsuite>
</testsuites>
</phpunit>
10 changes: 5 additions & 5 deletions phpunit-7.4.xml → tests/phpunit-7.4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -15,16 +15,16 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./src</directory>
<directory>./../src</directory>
</include>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
<directory>./../vendor</directory>
<directory>./../tests</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="PhpArrayToXml Test Suite">
<directory>./tests/</directory>
<directory>./../tests/</directory>
</testsuite>
</testsuites>
</phpunit>
10 changes: 5 additions & 5 deletions phpunit-8.0.xml → tests/phpunit-8.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -15,16 +15,16 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./src</directory>
<directory>./../src</directory>
</include>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
<directory>./../vendor</directory>
<directory>./../tests</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="PhpArrayToXml Test Suite">
<directory>./tests/</directory>
<directory>./../tests/</directory>
</testsuite>
</testsuites>
</phpunit>
10 changes: 5 additions & 5 deletions phpunit-8.1.xml → tests/phpunit-8.1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -15,16 +15,16 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./src</directory>
<directory>./../src</directory>
</include>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
<directory>./../vendor</directory>
<directory>./../tests</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="PhpArrayToXml Test Suite">
<directory>./tests/</directory>
<directory>./../tests/</directory>
</testsuite>
</testsuites>
</phpunit>