jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/361619 )
Change subject: resourceloader: Complete test coverage for
FileModule::getTemplates()
......................................................................
resourceloader: Complete test coverage for FileModule::getTemplates()
* Add coverage for the 'else' branch for file not existing and
an exception being thrown.
Change-Id: Ia7d608f1ed72f07f46b969046d9c9910fbfd738d
---
M tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
1 file changed, 16 insertions(+), 1 deletion(-)
Approvals:
Bartosz Dziewoński: Looks good to me, approved
jenkins-bot: Verified
diff --git
a/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
b/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
index 7d12e59..9a03d3c 100644
--- a/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
+++ b/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
@@ -41,6 +41,12 @@
]
],
+ 'htmlTemplateUnknown' => $base + [
+ 'templates' => [
+ 'templates/notfound.html',
+ ]
+ ],
+
'aliasedHtmlTemplateModule' => $base + [
'templates' => [
'foo.html' => 'templates/template.html',
@@ -259,6 +265,10 @@
'bar.html' => "<div>goodbye</div>\n",
],
],
+ [
+ $modules['htmlTemplateUnknown'],
+ false,
+ ],
];
}
@@ -270,7 +280,12 @@
$rl = new ResourceLoaderFileModule( $module );
$rl->setName( 'testing' );
- $this->assertEquals( $rl->getTemplates(), $expected );
+ if ( $expected === false ) {
+ $this->setExpectedException( MWException::class );
+ $rl->getTemplates();
+ } else {
+ $this->assertEquals( $rl->getTemplates(), $expected );
+ }
}
public function testBomConcatenation() {
--
To view, visit https://gerrit.wikimedia.org/r/361619
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia7d608f1ed72f07f46b969046d9c9910fbfd738d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits