Sbisson has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/342647 )
Change subject: Make unit tests independent from local config
......................................................................
Make unit tests independent from local config
Change-Id: I870a5e39bcf0758965bd602c1ec2e02225f0a295
---
M tests/phpunit/includes/HooksTest.php
1 file changed, 18 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES
refs/changes/47/342647/1
diff --git a/tests/phpunit/includes/HooksTest.php
b/tests/phpunit/includes/HooksTest.php
index 7b1122d..17b63b4 100644
--- a/tests/phpunit/includes/HooksTest.php
+++ b/tests/phpunit/includes/HooksTest.php
@@ -64,8 +64,17 @@
}
public function testOnChangesListSpecialPageFilters() {
+ $this->setMwGlobals( [
+ 'wgUser' => $this->user,
+ 'wgOresModels' => [
+ 'damaging' => true,
+ 'goodfaith' => true,
+ ]
+ ] );
$filters = [];
- $clsp = $this->getMock( ChangesListSpecialPage::class );
+ $clsp = $this->getMockBuilder( ChangesListSpecialPage::class )
+ ->disableOriginalConstructor()
+ ->getMock();
$clsp->expects( $this->any() )
->method( 'getUser' )
@@ -359,6 +368,14 @@
}
public function testOnEnhancedChangesListModifyLineDataGoodfaith() {
+ $this->setMwGlobals( [
+ 'wgUser' => $this->user,
+ 'wgOresModels' => [
+ 'damaging' => false,
+ 'goodfaith' => true,
+ ]
+ ] );
+
$row = new \stdClass();
$row->ores_goodfaith_score = 0.3;
$row->rc_patrolled = 1;
--
To view, visit https://gerrit.wikimedia.org/r/342647
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I870a5e39bcf0758965bd602c1ec2e02225f0a295
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Sbisson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits