From: Kunal Mehta Date: Fri, 18 Jan 2019 21:57:43 +0000 (-0800) Subject: registration: Add @codeCoverageIgnore for statement that can't be covered X-Git-Tag: 1.34.0-rc.0~3049^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/Category:Foo?a=commitdiff_plain;h=f31e172f415ba2ab7163609ac488d3865f5a1101;p=lhc%2Fweb%2Fwiklou.git registration: Add @codeCoverageIgnore for statement that can't be covered MW_PHPUNIT_TEST will always be defined during tests, so we can't have a test that requires it to be undefined. Change-Id: I67b011af31026bc9c568725f8f294359b63f2fd5 --- diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index e3bd54289c..88d9fd3f99 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -433,9 +433,11 @@ class ExtensionRegistry { * @since 1.33 */ public function setAttributeForTest( $name, array $value ) { + // @codeCoverageIgnoreStart if ( !defined( 'MW_PHPUNIT_TEST' ) ) { throw new RuntimeException( __METHOD__ . ' can only be used in tests' ); } + // @codeCoverageIgnoreEnd if ( isset( $this->testAttributes[$name] ) ) { throw new Exception( "The attribute '$name' has already been overridden" ); }