*
* @param Config|null $bootstrapConfig The bootstrap config to use with the new
* MediaWikiServices.
+ * @return MediaWikiServices
*/
protected static function resetGlobalServices( Config $bootstrapConfig = null ) {
$oldServices = MediaWikiServices::getInstance();
private function resetDB( $db, $tablesUsed ) {
if ( $db ) {
$userTables = [ 'user', 'user_groups', 'user_properties' ];
- $coreDBDataTables = array_merge( $userTables, [ 'page', 'revision' ] );
+ $pageTables = [ 'page', 'revision', 'ip_changes', 'revision_comment_temp', 'comment' ];
+ $coreDBDataTables = array_merge( $userTables, $pageTables );
- // If any of the user tables were marked as used, we should clear all of them.
+ // If any of the user or page tables were marked as used, we should clear all of them.
if ( array_intersect( $tablesUsed, $userTables ) ) {
$tablesUsed = array_unique( array_merge( $tablesUsed, $userTables ) );
TestUserRegistry::clear();
}
+ if ( array_intersect( $tablesUsed, $pageTables ) ) {
+ $tablesUsed = array_unique( array_merge( $tablesUsed, $pageTables ) );
+ }
$truncate = in_array( $db->getType(), [ 'oracle', 'mysql' ] );
foreach ( $tablesUsed as $tbl ) {
*
* @since 1.20
*
- * @param array $array
+ * @param array &$array
*/
protected function objectAssociativeSort( array &$array ) {
uasort(
*
* @since 1.20
*
- * @param mixed $r The array to remove string keys from.
+ * @param mixed &$r The array to remove string keys from.
*/
protected static function stripStringKeys( &$r ) {
if ( !is_array( $r ) ) {
/**
* Used as a marker to prevent wfResetOutputBuffers from breaking PHPUnit.
+ * @param string $buffer
* @return string
*/
public static function wfResetOutputBuffersBarrier( $buffer ) {