Skip to content

Make use of the local phpunit.xsd #652

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
1 commit merged into from
Oct 26, 2019
Merged

Conversation

julienfalque
Copy link
Contributor

Q A
License MIT
Doc issue/PR -

Using the local phpunit.xsd file guarantees we use the exact version that is installed. It also improves DX with PhpStorm as it becomes able to validate phpunit.xml without manually registering XSD file's URI.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Pull request passes validation.

Copy link
Contributor

@Pierstoval Pierstoval left a comment

Choose a reason for hiding this comment

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

It won't work for symfony/simple-phpunit because phpunit is not required in composer.json and therefore not installed in the vendor dir.

The bin/phpunit file states that it's installed in bin/.phpunit/phpunit-{version}/, therefore the version should be changed in the bridge's xml files.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Pull request passes validation.

fabpot added a commit to symfony/symfony that referenced this pull request Sep 30, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

Copy phpunit.xsd to a predictable path

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes-ish
| Deprecations? | no
| Tickets       | symfony/recipes#652 (comment)
| License       | MIT
| Doc PR        | -

In symfony/recipes#652 I would like to make Flex create the `phpunit.xml.dist` file with a local URI for the `phpunit.xsd`. This is doable when using `phpunit/phpunit` standalone because the path to the XSD file is known. This PR aims to allow doing this when using the PHPUnit Bridge, which installs PHPUnit in a path that might change.

Is is simple `@copy()` call ok? Should I add some error handling?

Commits
-------

233dcb4 Copy phpunit.xsd to a predictable path
ghost pushed a commit that referenced this pull request Oct 26, 2019
@ghost ghost merged commit 3132df9 into symfony:master Oct 26, 2019
@julienfalque julienfalque deleted the local-phpunit-xsd branch October 26, 2019 10:06
@Tobion
Copy link
Contributor

Tobion commented Nov 5, 2019

This is so good. Thanks for the idea.

This pull request was closed.
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.

5 participants