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

Where do I put this XML code to use your plugin? #3

Open
wbtdc opened this issue Mar 26, 2019 · 1 comment
Open

Where do I put this XML code to use your plugin? #3

wbtdc opened this issue Mar 26, 2019 · 1 comment

Comments

@wbtdc
Copy link

wbtdc commented Mar 26, 2019

I tried putting it in my phpunit.xml.dist in these 4 different places, but it didn't work in any of them:
`

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.2/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
(I tried putting listener here without the <.../>

<php>
    <ini name="error_reporting" value="-1"/>
    <server name="KERNEL_CLASS" value="PhpList\Core\Core\ApplicationKernel"/>
    <listener class="\PhpunitMemoryAndTimeUsageListener\Listener\Measurement\TimeAndMemoryTestListener"/>
    
</php>
<testsuites>
	<testsuite name="default">
		<!--<directory suffix=".php">./tests/Unit</directory>-->
		<directory suffix=".php">./tests/Integration/Controller</directory>	
		<!--also tried putting listener here with the </>-->	
	</testsuite>    
    <!--also tried putting listener here with the </>-->		
</testsuites>
<!--also tried putting listener here with the </> surrounding it-->
`

Could you let me know where the tag goes? I'm guessing now not in phpunit.xml.dist at all, but I'm not sure where else it would go for running phpunit tests.

Thanks! :)
Dave

@DonovanChan
Copy link

For anyone else checking here, the <listener> tag belongs inside a <listeners> element. E.g.,

<?xml version="1.0" encoding="UTF-8"?>
<phpunit>
    <testsuites></testsuites>
    <listeners>
        <listener class="\PhpunitMemoryAndTimeUsageListener\Listener\Measurement\TimeAndMemoryTestListener"/>
    </listeners>
</phpunit>

See also, phpunit.xml docs.

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

No branches or pull requests

2 participants