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

Add max nesting level configuration option #46

Closed

Conversation

olsavmic
Copy link
Sponsor

@olsavmic olsavmic commented May 6, 2022

@olsavmic olsavmic force-pushed the olsavmic-max-nesting-level branch from 1d57ee9 to d7ff650 Compare May 6, 2022 09:30
@sebastianbergmann
Copy link
Owner

How do you envision configuring this setting from PHPUnit?

@olsavmic
Copy link
Sponsor Author

olsavmic commented Aug 5, 2022

Ideally as a phpunit element attribute in the XMLConfiguration.

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
        colors="true"
        exporterMaxDepth=5
>
...
</phpunit>

I see that the Exporter is being created in a lot of different places, especially in the \PHPUnit\Framework\Constraint\Constraint::exporter() method.

I don't see a reason to keep an instance of Exporter per Constraint (or any formatted object), I'd suggest passing the Exporter instance into the toString() and similar methods instead.

That'd require a bit of refactoring though and since it's a global configuration of a testing environment only, I'd be fine with accessing a public static configuration variable during Exporter instantiation.

@sebastianbergmann
Copy link
Owner

Superseded by #55.

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.

2 participants