Merge "Give TestCase::checkHasDiff3 a better name"
[lhc/web/wiklou.git] / maintenance / benchmarks / bench_strtr_str_replace.php
index bd21b18..f34d27f 100644 (file)
@@ -38,11 +38,10 @@ function bfNormalizeTitleStrReplace( $str ) {
  *
  * @ingroup Benchmark
  */
-class bench_strtr_str_replace extends Benchmarker {
-
+class BenchStrtrStrReplace extends Benchmarker {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Benchmark for strtr() vs str_replace().";
+               $this->addDescription( 'Benchmark for strtr() vs str_replace().' );
        }
 
        public function execute() {
@@ -51,7 +50,7 @@ class bench_strtr_str_replace extends Benchmarker {
                        array( 'function' => array( $this, 'benchstr_replace' ) ),
                        array( 'function' => array( $this, 'benchstrtr_indirect' ) ),
                        array( 'function' => array( $this, 'benchstr_replace_indirect' ) ),
-               ));
+               ) );
                print $this->getFormattedResults();
        }
 
@@ -60,10 +59,9 @@ class bench_strtr_str_replace extends Benchmarker {
        }
 
        function benchstr_replace() {
-               str_replace( "_", " ", "[[MediaWiki:Some_random_test_page]]");
+               str_replace( "_", " ", "[[MediaWiki:Some_random_test_page]]" );
        }
 
-
        function benchstrtr_indirect() {
                bfNormalizeTitleStrTr( "[[MediaWiki:Some_random_test_page]]" );
        }
@@ -71,8 +69,7 @@ class bench_strtr_str_replace extends Benchmarker {
        function benchstr_replace_indirect() {
                bfNormalizeTitleStrReplace( "[[MediaWiki:Some_random_test_page]]" );
        }
-
 }
 
-$maintClass = 'bench_strtr_str_replace';
+$maintClass = 'BenchStrtrStrReplace';
 require_once RUN_MAINTENANCE_IF_MAIN;