Skip to content

Conversation

@GromNaN
Copy link
Member

@GromNaN GromNaN commented Oct 16, 2025

Extracted from #450 (comment)

@GromNaN GromNaN force-pushed the phpunit-details branch 2 times, most recently from b312f48 to 855487c Compare October 16, 2025 21:45
phpunit.xml.dist Outdated
beStrictAboutOutputDuringTests="true"
displayDetailsOnPhpunitDeprecations="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding displayDetailsOnTestsThatTriggerErrors: what's the difference between having it and the default behavior?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GromNaN I tried throw \Error inside a test, and couldn't find a difference with or without this setting, so let's remove it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The different is with trigger_error('Hello World', E_USER_ERROR).

  PHPUnit 12.4.1 by Sebastian Bergmann and contributors.
  
  Runtime:       PHP 8.4.8
  Configuration: /Users/jerome/Develop/doctrine-persistence/phpunit.xml.dist

  E                                                                   1 / 1 (100%)

  Time: 00:00.006, Memory: 16.00 MB

  There was 1 error:
  
  1) ErrorTest::testError
  E_USER_ERROR was triggered
  tests/ErrorTest.php:9

+ --
+ 
+ 1 test triggered 1 error:
+ 
+ 1) tests/ErrorTest.php:9
+ Hello World
+
  ERRORS!
  Tests: 1, Assertions: 0, Errors: 2, Deprecations: 1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice! I guess it could be useful to have the "Hello World" part.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was my test:

<?php

use PHPUnit\Framework\TestCase;

class ErrorTest extends TestCase
{
    public function testError(): void
    {
        trigger_error('Hello World', E_USER_ERROR);
    }
}

greg0ire
greg0ire previously approved these changes Oct 20, 2025
SenseException
SenseException previously approved these changes Oct 20, 2025
@GromNaN GromNaN dismissed stale reviews from SenseException and greg0ire via 22dfdbe October 21, 2025 15:25
@GromNaN
Copy link
Member Author

GromNaN commented Oct 21, 2025

We get deprecation with PHP 8.1, without message

PHPUnit 10.5.58 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.1.33 with PCOV 1.0.12
Configuration: /home/runner/work/persistence/persistence/phpunit.xml.dist

...................................................DS..........  63 / 137 ( 45%)
............................................................... 126 / 137 ( 91%)
...........                                                     137 / 137 (100%)

Time: 00:00.258, Memory: 22.00 MB

OK, but there were issues!
Tests: 137, Assertions: 249, Deprecations: 10, Skipped: 1.

Generating code coverage report in Clover XML format ... done [00:00.020]

@xabbuh
Copy link
Member

xabbuh commented Oct 21, 2025

When the job uses lowest dependencies, PHPUnit should probably be instructed to not fail when detecting deprecations using the --do-not-fail-on-deprecation flag.

@GromNaN
Copy link
Member Author

GromNaN commented Oct 23, 2025

I updated the Action. PR is ready.

Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@GromNaN GromNaN merged commit 48c1dab into doctrine:4.1.x Oct 23, 2025
12 checks passed
@GromNaN GromNaN deleted the phpunit-details branch October 23, 2025 15:29
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.

4 participants