From f31e172f415ba2ab7163609ac488d3865f5a1101 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 18 Jan 2019 13:57:43 -0800 Subject: [PATCH] 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 --- includes/registration/ExtensionRegistry.php | 2 ++ 1 file changed, 2 insertions(+) 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" ); } -- 2.20.1