Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:Hooks/UnitTestsAfterDatabaseSetup

From mediawiki.org
<Manual:Hooks
UnitTestsAfterDatabaseSetup
Available fromversion 1.30.0
Called right after MediaWiki's test infrastructure has finished creating/duplicating core tables for unit tests.
Define function:
publicstaticfunctiononUnitTestsAfterDatabaseSetup($database,$prefix){...}
Attach hook:Inextension.json:
{"Hooks":{"UnitTestsAfterDatabaseSetup":"MediaWiki\\Extension\\MyExtension\\Hooks::onUnitTestsAfterDatabaseSetup"}}
Called from:File(s):../tests/phpunit/MediaWikiIntegrationTestCase.php
Interface:UnitTestsAfterDatabaseSetupHook.php

For more information about attaching hooks, seeManual:Hooks.
For examples of extensions using this hook, seeCategory:UnitTestsAfterDatabaseSetup extensions.

Details

[edit]
  • $database: Database in question
  • $prefix: Table prefix to be used in unit tests

Notes

[edit]

Use this hook to add your database setup to the test database before any tests are run.

Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:Hooks/UnitTestsAfterDatabaseSetup&oldid=3295656"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp