jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/401833 )
Change subject: Added Tests for ListToggle
..
Added Tests for ListToggle
Bug: T183898
Change-Id: I1c6cd8ea21127db56701cc6073fa880b2180d846
---
A tests/phpunit/includes/ListToggleTest.php
1 file changed, 49 insertions(+), 0 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/includes/ListToggleTest.php
b/tests/phpunit/includes/ListToggleTest.php
new file mode 100644
index 000..7bbf448
--- /dev/null
+++ b/tests/phpunit/includes/ListToggleTest.php
@@ -0,0 +1,49 @@
+getMockBuilder( 'OutputPage' )
+ ->setMethods( null )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $listToggle = new ListToggle( $output );
+
+ $this->assertInstanceOf( 'ListToggle', $listToggle );
+ $this->assertContains( 'mediawiki.checkboxtoggle',
$output->getModules() );
+ $this->assertContains( 'mediawiki.checkboxtoggle.styles',
$output->getModuleStyles() );
+ }
+
+ /**
+* @covers ListToggle::getHTML
+*/
+ public function testGetHTML() {
+ $output = $this->createMock( 'OutputPage' );
+ $output->expects( $this->any() )
+ ->method( 'msg' )
+ ->will( $this->returnCallback( function ( $key ) {
+ return wfMessage( $key )->inLanguage( 'qqx' );
+ } ) );
+ $output->expects( $this->once() )
+ ->method( 'getLanguage' )
+ ->will( $this->returnValue( Language::factory( 'qqx' )
) );
+
+ $listToggle = new ListToggle( $output );
+
+ $html = $listToggle->getHTML();
+ $this->assertEquals( '' .
+ '(checkbox-select: (checkbox-all)(comma-separator)' .
+ '' .
+ '(checkbox-none)(comma-separator)(checkbox-invert))',
+ $html );
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/401833
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1c6cd8ea21127db56701cc6073fa880b2180d846
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ryan10145
Gerrit-Reviewer: Florianschmidtwelzow
Gerrit-Reviewer: Legoktm
Gerrit-Reviewer: jenkins-bot <>
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits