includes/Hooks.php 1 location
|
@@ 66-72 (lines=7) @@
|
63 |
|
* @since 1.21 |
64 |
|
* @throws MWException If not in testing mode. |
65 |
|
*/ |
66 |
|
public static function clear( $name ) { |
67 |
|
if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) { |
68 |
|
throw new MWException( 'Cannot reset hooks in operation.' ); |
69 |
|
} |
70 |
|
|
71 |
|
unset( self::$handlers[$name] ); |
72 |
|
} |
73 |
|
|
74 |
|
/** |
75 |
|
* Returns true if a hook has a function registered to it. |
includes/MediaWikiServices.php 1 location
|
@@ 325-331 (lines=7) @@
|
322 |
|
* |
323 |
|
* @throws MWException if called outside of PHPUnit tests. |
324 |
|
*/ |
325 |
|
public function resetServiceForTesting( $name, $destroy = true ) { |
326 |
|
if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) { |
327 |
|
throw new MWException( 'resetServiceForTesting() must not be used outside unit tests.' ); |
328 |
|
} |
329 |
|
|
330 |
|
$this->resetService( $name, $destroy ); |
331 |
|
} |
332 |
|
|
333 |
|
/** |
334 |
|
* Convenience method that throws an exception unless it is called during a phase in which |