Skip to content

Fix missing key for time-sensitive tests #7391

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
merged 1 commit into from
Jan 24, 2017
Merged

Conversation

z38
Copy link
Contributor

@z38 z38 commented Jan 19, 2017

The Symfony test listener prints a warning when numeric keys are used to configure mocked namespaces.

As the specification of multiple namespaces might be a bit intuitive (I can't add multiple <element key="time-sensitive">), maybe the following example would be better:

<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
    <arguments>
        <array>
            <element key="time-sensitive">
                <array>
                    <element><string>Symfony\Component\HttpFoundation</string></element>
                </array>
            </element>
        </array>
    </arguments>
</listener>

@xabbuh
Copy link
Member

xabbuh commented Jan 19, 2017

👍

Status: Reviewed

@xabbuh
Copy link
Member

xabbuh commented Jan 24, 2017

Thank you @z38.

@xabbuh xabbuh merged commit 1d1c58b into symfony:2.8 Jan 24, 2017
xabbuh added a commit that referenced this pull request Jan 24, 2017
This PR was merged into the 2.8 branch.

Discussion
----------

Fix missing key for time-sensitive tests

The Symfony test listener [prints a warning](https://github.com/symfony/symfony/blob/4491eb64633f1945537e8a6a07adbb3ef5c1f802/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php#L66) when numeric keys are used to configure mocked namespaces.

As the specification of multiple namespaces might be a bit intuitive (I can't add multiple `<element key="time-sensitive">`), maybe the following example would be better:
```xml
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
    <arguments>
        <array>
            <element key="time-sensitive">
                <array>
                    <element><string>Symfony\Component\HttpFoundation</string></element>
                </array>
            </element>
        </array>
    </arguments>
</listener>
```

Commits
-------

1d1c58b Fix missing key for time-sensitive tests
@xabbuh
Copy link
Member

xabbuh commented Jan 24, 2017

@z38 I have merged your changes as is. As I don't think people will often register more than one listener with the time-sensitive key making the example more verbose will just add confusion.

@z38 z38 deleted the fix-phpunitxml branch January 26, 2017 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants