jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/399635 )
Change subject: Stop MediaWikiTestCase defition appearing for IDEs
......................................................................
Stop MediaWikiTestCase defition appearing for IDEs
This has been annoying me for a while now.
As I have core and all extensions checked out, my IDE
detects this defition of MediaWikiTestCase as the first,
and as a result all of my typhinting for the actual class
is off.
This patch uses a class alias instead of defining a class and
wraps that in a call_user_func to hide it from IDEs
Change-Id: Iadb86b051da707fa6d6ecee8b7ffe38bd87fff63
---
M tests/phpunit/MediaWikiFarmTestCase.php
1 file changed, 8 insertions(+), 4 deletions(-)
Approvals:
Seb35: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/MediaWikiFarmTestCase.php
b/tests/phpunit/MediaWikiFarmTestCase.php
index b73f675..2bfef64 100644
--- a/tests/phpunit/MediaWikiFarmTestCase.php
+++ b/tests/phpunit/MediaWikiFarmTestCase.php
@@ -23,9 +23,11 @@
/**
* Placeholder for MediaWikiTestCase when standalone PHPUnit is
executed.
*
- * @package MediaWiki\Tests
+ * Use a class alias instead of creating a new
MediaWikiTestCase.
+ * Wrap the alias in a call_user_func call to avoid making IDEs
think this is the main
+ * MediaWikiTestCase definition.
*/
- class MediaWikiTestCase extends PHPUnit\Framework\TestCase {}
+ call_user_func( 'class_alias', 'PHPUnit\Framework\TestCase',
'MediaWikiTestCase' );
}
# PHPUnit < 6.0
@@ -34,9 +36,11 @@
/**
* Placeholder for MediaWikiTestCase when standalone PHPUnit is
executed.
*
- * @package MediaWiki\Tests
+ * Use a class alias instead of creating a new
MediaWikiTestCase.
+ * Wrap the alias in a call_user_func call to avoid making IDEs
think this is the main
+ * MediaWikiTestCase definition.
*/
- class MediaWikiTestCase extends PHPUnit_Framework_TestCase {}
// @codingStandardsIgnoreLine Generic.Classes.DuplicateClassName.Found
+ call_user_func( 'class_alias', 'PHPUnit_Framework_TestCase',
'MediaWikiTestCase' );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/399635
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iadb86b051da707fa6d6ecee8b7ffe38bd87fff63
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MediaWikiFarm
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Seb35 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits