Manual:Hooks/UnitTestsBeforeDatabaseTeardown

Category:MediaWiki hooks#UnitTestsBeforeDatabaseTeardown Category:Hooks added in MediaWiki 1.30.0#UnitTestsBeforeDatabaseTeardown
UnitTestsBeforeDatabaseTeardown
Available from version 1.30.0
Called right before MediaWiki's test infrastructure begins tearing down tables for unit tests.
Define function:
public static function onUnitTestsBeforeDatabaseTeardown(  ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UnitTestsBeforeDatabaseTeardown": "MediaWiki\\Extension\\MyExtension\\Hooks::onUnitTestsBeforeDatabaseTeardown"
	}
}
Called from: File(s): ../tests/phpunit/MediaWikiIntegrationTestCase.phpCategory:MediaWiki hooks included in MediaWikiIntegrationTestCase.php#UnitTestsBeforeDatabaseTeardown
Interface: UnitTestsBeforeDatabaseTeardownHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:UnitTestsBeforeDatabaseTeardown extensions.

Notes

Use this hook to clean up your test database after all tests are run from changes introduced e.g. via UnitTestsAfterDatabaseSetup.

Category:Hooks added in MediaWiki 1.30.0 Category:MediaWiki hooks Category:MediaWiki hooks included in MediaWikiIntegrationTestCase.php