HooksTest: Covers Hooks::callHook too
[lhc/web/wiklou.git] / maintenance / cleanupPreferences.php
index 4e19b79..6e58ae9 100644 (file)
@@ -34,16 +34,16 @@ class CleanupPreferences extends Maintenance {
        public function execute() {
                global $wgHiddenPrefs;
 
-               $dbw = wfGetDB( DB_MASTER );
-               $dbw->begin( __METHOD__ );
+               $dbw = $this->getDB( DB_MASTER );
+               $this->beginTransaction( $dbw, __METHOD__ );
                foreach ( $wgHiddenPrefs as $item ) {
                        $dbw->delete(
                                'user_properties',
-                               array( 'up_property' => $item ),
+                               [ 'up_property' => $item ],
                                __METHOD__
                        );
                };
-               $dbw->commit( __METHOD__ );
+               $this->commitTransaction( $dbw, __METHOD__ );
                $this->output( "Finished!\n" );
        }
 }