Add @covers tags to miscellaneous tests (#2)
[lhc/web/wiklou.git] / tests / phpunit / includes / exception / MWExceptionTest.php
index 7c36f7d..6c5b3b1 100644 (file)
@@ -10,6 +10,7 @@ class MWExceptionTest extends MediaWikiTestCase {
 
        /**
         * @expectedException MWException
+        * @covers MWException
         */
        public function testMwexceptionThrowing() {
                throw new MWException();
@@ -75,53 +76,6 @@ class MWExceptionTest extends MediaWikiTestCase {
                $this->assertTrue( $e->isLoggable() );
        }
 
-       /**
-        * @dataProvider provideRunHooks
-        * @covers MWException::runHooks
-        */
-       public function testRunHooks( $wgExceptionHooks, $name, $args, $expectedReturn ) {
-               $this->setMwGlobals( [
-                       'wgExceptionHooks' => $wgExceptionHooks,
-               ] );
-               $e = new MWException();
-               $this->assertEquals( $expectedReturn, $e->runHooks( $name, $args ) );
-       }
-
-       public static function provideRunHooks() {
-               return [
-                       [ null, null, null, null ],
-                       [ [], 'name', [], null ],
-                       [ [ 'name' => false ], 'name', [], null ],
-                       [
-                               [ 'mockHook' => [ 'MWExceptionTest::mockHook' ] ],
-                               'mockHook', [], 'YAY.[]'
-                       ],
-                       [
-                               [ 'mockHook' => [ 'MWExceptionTest::mockHook' ] ],
-                               'mockHook', [ 'a' ], 'YAY.{"1":"a"}'
-                       ],
-                       [
-                               [ 'mockHook' => [ 'MWExceptionTest::mockHook' ] ],
-                               'mockHook', [ null ], null
-                       ],
-               ];
-       }
-
-       /**
-        * Used in conjunction with provideRunHooks and testRunHooks as a mock callback for a hook
-        */
-       public static function mockHook() {
-               $args = func_get_args();
-               if ( !$args[0] instanceof MWException ) {
-                       return '$caller not instance of MWException';
-               }
-               unset( $args[0] );
-               if ( array_key_exists( 1, $args ) && $args[1] === null ) {
-                       return null;
-               }
-               return 'YAY.' . json_encode( $args );
-       }
-
        /**
         * @dataProvider provideIsCommandLine
         * @covers MWException::isCommandLine