jenkins-bot has submitted this change and it was merged.
Change subject: Actually run all the tests (and fix the broken ones!)
......................................................................
Actually run all the tests (and fix the broken ones!)
Change-Id: Iad11e9362b64e067e2d99fa4194a9d309734348b
---
M Gadgets.hooks.php
M tests/content/GadgetDefinitionContentTest.php
2 files changed, 18 insertions(+), 5 deletions(-)
Approvals:
Addshore: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Gadgets.hooks.php b/Gadgets.hooks.php
index 0ec735f..025c8cc 100644
--- a/Gadgets.hooks.php
+++ b/Gadgets.hooks.php
@@ -391,9 +391,22 @@
* @return bool
*/
public static function onUnitTestsList( array &$files ) {
- $testDir = __DIR__ . '/tests/';
- $files = array_merge( $files, glob( "$testDir/*Test.php" ) );
+ // @codeCoverageIgnoreStart
+ $directoryIterator = new RecursiveDirectoryIterator( __DIR__ .
'/tests/' );
+
+ /**
+ * @var SplFileInfo $fileInfo
+ */
+ $ourFiles = array();
+ foreach ( new RecursiveIteratorIterator( $directoryIterator )
as $fileInfo ) {
+ if ( substr( $fileInfo->getFilename(), -8 ) ===
'Test.php' ) {
+ $ourFiles[] = $fileInfo->getPathname();
+ }
+ }
+
+ $files = array_merge( $files, $ourFiles );
return true;
+ // @codeCoverageIgnoreEnd
}
/**
diff --git a/tests/content/GadgetDefinitionContentTest.php
b/tests/content/GadgetDefinitionContentTest.php
index ad464bc..374578c 100644
--- a/tests/content/GadgetDefinitionContentTest.php
+++ b/tests/content/GadgetDefinitionContentTest.php
@@ -140,8 +140,8 @@
private function getMockWikiPage() {
$page = $this->getMockBuilder( 'WikiPage'
)->disableOriginalConstructor()
->getMock();
- $page->expects( $this->any() )->method( 'exists' )->willReturn(
true );
- $page->expects( $this->any() )->method( 'getTitle'
)->willReturn( Title::newMainPage() );
+ $page->expects( $this->any() )->method( 'exists' )->will(
$this->returnValue( true ) );
+ $page->expects( $this->any() )->method( 'getTitle' )->will(
$this->returnValue( Title::newMainPage() ) );
return $page;
}
@@ -162,7 +162,7 @@
$oldContent = new GadgetDefinitionContent( '{}' );
$newContent = new GadgetDefinitionContent( '{"settings":
{"skins": ["vector", "monobook"]}}' );
$parserOutput = $this->getMock( 'ParserOutput' );
- $parserOutput->expects( $this->any() )->method(
'getSecondaryDataUpdates' )->willReturn( array() );
+ $parserOutput->expects( $this->any() )->method(
'getSecondaryDataUpdates' )->will( $this->returnValue( array() ) );
$found = false;
$updates = $newContent->getSecondaryDataUpdates(
Title::newMainPage(), $oldContent, true, $parserOutput );
foreach ( $updates as $update ) {
--
To view, visit https://gerrit.wikimedia.org/r/159109
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iad11e9362b64e067e2d99fa4194a9d309734348b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Gadgets
Gerrit-Branch: RL2
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits