exporter
exporter copied to clipboard
Add max nesting level configuration option
Prerequisite for https://github.com/sebastianbergmann/phpunit/issues/4965#issue-1224068762
How do you envision configuring this setting from PHPUnit?
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.