diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ca6222b..aace3d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + php-version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] steps: - uses: actions/checkout@v3 @@ -34,7 +34,7 @@ jobs: run: | 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 + ./vendor/bin/phpunit -c ./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 diff --git a/.gitignore b/.gitignore index bbd3373..1debf85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .idea composer.lock vendor -/coverage/ +/coverage/ \ No newline at end of file diff --git a/README.md b/README.md index ed2bf74..6ad7a77 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ - + +

diff --git a/composer.json b/composer.json index 40d9157..8f2ffc5 100644 --- a/composer.json +++ b/composer.json @@ -21,10 +21,10 @@ } ], "require": { - "php" : "^8.0|^7.0" + "php": "^8.0|^7.0" }, "require-dev": { - "phpunit/phpunit" : "^9.5|^8.5|^7.5|^6.5", + "phpunit/phpunit": "^10.5|^9.5|^8.5|^7.5|^6.5", "mockery/mockery": "^1.0" }, "autoload": { diff --git a/src/Traits/DomDocumentBuilder.php b/src/Traits/DomDocumentBuilder.php index 30dc102..5b7de4d 100644 --- a/src/Traits/DomDocumentBuilder.php +++ b/src/Traits/DomDocumentBuilder.php @@ -184,11 +184,12 @@ protected function createXmlElement($name, $value = null, $cdata = false, $attri return $element; } - - $element = $this->_doc->createElement($name, $this->normalizeValue($value)); + $normalizedValue = $this->normalizeValue($value); + $element = $this->_doc->createElement($name, $normalizedValue === null ? '' : $normalizedValue); foreach ($attributes as $attribute_name => $attribute_value) { - $element->setAttribute($attribute_name, $this->normalizeAttributeValue($attribute_value)); + $normalizedValue = $this->normalizeAttributeValue($attribute_value); + $element->setAttribute($attribute_name, $normalizedValue === null ? '' : $normalizedValue); } return $element; diff --git a/tests/phpunit-8.2.xml b/tests/phpunit-8.2.xml new file mode 100644 index 0000000..206f4e4 --- /dev/null +++ b/tests/phpunit-8.2.xml @@ -0,0 +1,28 @@ + + + + + + ./../tests/ + + + + + ./../src + + + ./../vendor + ./../tests + + +