Skip to content

Check PHP configuration#68

Merged
greg0ire merged 1 commit intodoctrine:mainfrom
greg0ire:cpc
Oct 11, 2025
Merged

Check PHP configuration#68
greg0ire merged 1 commit intodoctrine:mainfrom
greg0ire:cpc

Conversation

@greg0ire
Copy link
Copy Markdown
Member

@greg0ire greg0ire commented Oct 11, 2025

Let us check that we are running PHPUnit in the right conditions, otherwise we could get surprises such as no error output.

Let us check that we are running PHPUnit in the right conditions,
otherwise we could get surprises such as no error output.
@greg0ire
Copy link
Copy Markdown
Member Author

greg0ire commented Oct 11, 2025

  • It does nothing when the version of PHPUnit is too low: 9
  • It does something when the version of PHPUnit is high enough:

@greg0ire greg0ire merged commit 698b5c0 into doctrine:main Oct 11, 2025
Comment on lines +79 to +81
if vendor/bin/phpunit --atleast-version 12.3.1 > /dev/null ||
vendor/bin/phpunit --atleast-version 11.5.29 > /dev/null ||
vendor/bin/phpunit --atleast-version 10.5.49 > /dev/null; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this logic so complicated? Isn't this the same as checking for 10.5.49 only?

Copy link
Copy Markdown
Member Author

@greg0ire greg0ire Oct 12, 2025

Choose a reason for hiding this comment

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

Here is the command that I've run to dertermine which constraints to use:

$ git tag --contains 4a39279a273a420fb1c2a2afc298982b3fb56c32
12.4.1
12.4.0
12.3.15
12.3.14
12.3.13
12.3.12
12.3.11
12.3.10
12.3.9
12.3.8
12.3.7
12.3.6
12.3.5
12.3.4
12.3.3
12.3.2
12.3.1
11.5.42
11.5.41
11.5.40
11.5.39
11.5.38
11.5.37
11.5.36
11.5.35
11.5.34
11.5.33
11.5.32
11.5.31
11.5.30
11.5.29
10.5.58
10.5.57
10.5.56
10.5.55
10.5.54
10.5.53
10.5.52
10.5.51
10.5.50
10.5.49

It seems to be that this was introduced in a patch version, then merged up. So I don't think it would work for e.g. 11.5.28

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems to be that this was introduced in a patch version, then merged up. So I don't think it would work for e.g. 11.5.28

I understand that. What I'm saying is, your command line does not exclude 11.5.28. In that case, your expression…

vendor/bin/phpunit --atleast-version 12.3.1 > /dev/null ||
vendor/bin/phpunit --atleast-version 11.5.29 > /dev/null ||
vendor/bin/phpunit --atleast-version 10.5.49 > /dev/null

… would evaluate to false || false || true which is true. Or am I missing something here?

Copy link
Copy Markdown
Member Author

@greg0ire greg0ire Oct 13, 2025

Choose a reason for hiding this comment

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

Oh no you're right, I'm the one missing something… so it should be even more complex than I originally thought 😭

Something like this:

          if vendor/bin/phpunit --atleast-version 12.3.1 > /dev/null ||
             vendor/bin/phpunit --atleast-version 11.5.29 > /dev/null && ! vendor/bin/phpunit --atleast-version 12.0.0 > /dev/null ||
             vendor/bin/phpunit --atleast-version 10.5.49 > /dev/null && ! vendor/bin/phpunit --atleast-version 11.0.0; then
            vendor/bin/phpunit --check-php-configuration;
          fi

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

#70

@greg0ire greg0ire deleted the cpc branch October 12, 2025 14:30
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.

3 participants