EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/191186
Change subject: More gracefully handle unavailability of ParserFunctions in
phpunit
......................................................................
More gracefully handle unavailability of ParserFunctions in phpunit
Change-Id: I375c13e937892062b061940b2b9ac5bdd832ac9d
---
M tests/phpunit/includes/DiscussionParserTest.php
1 file changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/86/191186/1
diff --git a/tests/phpunit/includes/DiscussionParserTest.php
b/tests/phpunit/includes/DiscussionParserTest.php
index 84f0230..bd2ba5b 100644
--- a/tests/phpunit/includes/DiscussionParserTest.php
+++ b/tests/phpunit/includes/DiscussionParserTest.php
@@ -244,6 +244,13 @@
'agent' => 'PatHadley',
),
),
+ 'precondition' => function() {
+ if ( class_exists( 'ExtParserFunctions'
) ) {
+ return true;
+ } else {
+ return "ParserFunctions not
enabled";
+ }
+ },
),
array(
'new' => 647260329,
@@ -271,7 +278,14 @@
/**
* @dataProvider generateEventsForRevisionData
*/
- public function testGenerateEventsForRevision( $newId, $oldId,
$username, $lang, $pages, $title, $expected ) {
+ public function testGenerateEventsForRevision( $newId, $oldId,
$username, $lang, $pages, $title, $expected, $precondition = null ) {
+ if ( $precondition instanceof Closure ) {
+ $result = $precondition();
+ if ( $precondition !== true ) {
+ $this->markTestSkipped( $precondition );
+ return;
+ }
+ }
$this->setMwGlobals( array(
// this global is used by the code that interprets the
namespace part of
// titles (Title::getTitleParser), so should be the
fake language ;)
--
To view, visit https://gerrit.wikimedia.org/r/191186
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I375c13e937892062b061940b2b9ac5bdd832ac9d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits