Skip to content
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

Remove unexpected formatOutput #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hettiger
Copy link

Fixes #66

@inxilpro
Copy link
Contributor

inxilpro commented Apr 6, 2024

@hettiger what version of PHP and Pest are you using? The formatOutput flag shouldn't affect the XML that's produced at all. It just tells PHP to format the XML output…

@hettiger
Copy link
Author

hettiger commented Apr 8, 2024

@hettiger what version of PHP and Pest are you using? The formatOutput flag shouldn't affect the XML that's produced at all. It just tells PHP to format the XML output…

Hi @inxilpro I'm using PHP 8.3 and Pest 2.

Reproduction steps:

  1. laravel new demo
  2. cd demo
  3. composer require internachi/modular
  4. php artisan modules:sync
  5. vendor/bin/pest
pest

   WARN  Test results may not be as expected because the XML configuration file did not pass validation:

  Line 29:
  - Element 'formatOutput': This element is not expected.


   PASS  Tests\Unit\ExampleTest
  ✓ that true is true                                                                                                                                                                                                           0.01s

   PASS  Tests\Feature\ExampleTest
  ✓ it returns a successful response                                                                                                                                                                                            0.15s

  Tests:    2 passed (2 assertions)
  Duration: 0.26s
diff --git a/phpunit.xml b/phpunit.xml
index 506b9a3..c4be529 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,9 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
-         bootstrap="vendor/autoload.php"
-         colors="true"
->
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
     <testsuites>
         <testsuite name="Unit">
             <directory>tests/Unit</directory>
@@ -11,7 +7,7 @@
         <testsuite name="Feature">
             <directory>tests/Feature</directory>
         </testsuite>
-    </testsuites>
+    <testsuite name="Modules"><directory suffix="Test.php">./app-modules/*/tests</directory></testsuite></testsuites>
     <source>
         <include>
             <directory>app</directory>
@@ -30,4 +26,4 @@
         <env name="SESSION_DRIVER" value="array"/>
         <env name="TELESCOPE_ENABLED" value="false"/>
     </php>
-</phpunit>
+<formatOutput>1</formatOutput></phpunit>
php -v
PHP 8.3.3 (cli) (built: Feb 16 2024 00:34:53) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.3, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.3, Copyright (c), by Zend Technologies

1818-        {
1819:            "name": "laravel/framework",
1820-            "version": "v11.2.0",
1821-            "source": {
1822-                "type": "git",
1823:                "url": "https://github.com/laravel/framework.git",
1824-                "reference": "a1750156b671f37cba702380107e2d22161c31e3"
1825-            },

7734-        {
7735:            "name": "pestphp/pest",
7736-            "version": "v2.34.7",
7737-            "source": {
7738-                "type": "git",
7739:                "url": "https://github.com/pestphp/pest.git",
7740-                "reference": "a7a3e4240e341d0fee1c54814ce18adc26ce5a76"
7741-            },

8711-        {
8712:            "name": "phpunit/phpunit",
8713-            "version": "10.5.17",
8714-            "source": {
8715-                "type": "git",
8716-                "url": "https://github.com/sebastianbergmann/phpunit.git",
8717-                "reference": "c1f736a473d21957ead7e94fcc029f571895abf5"

Of course i verified that removing the line $config->formatOutput = true; actually fixes the issue:

diff --git a/phpunit.xml b/phpunit.xml
index 506b9a3..af88ea5 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,9 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
-         bootstrap="vendor/autoload.php"
-         colors="true"
->
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
     <testsuites>
         <testsuite name="Unit">
             <directory>tests/Unit</directory>
@@ -11,7 +7,7 @@
         <testsuite name="Feature">
             <directory>tests/Feature</directory>
         </testsuite>
-    </testsuites>
+    <testsuite name="Modules"><directory suffix="Test.php">./app-modules/*/tests</directory></testsuite></testsuites>
     <source>
         <include>
             <directory>app</directory>

@bartdenhoed
Copy link

I have the same issue. Also using PHP 8.3 and Pest 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The modules:sync command causes a warning
3 participants