summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Admin/ConfigurationListTaskHandlerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Admin/ConfigurationListTaskHandlerTest.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Admin/ConfigurationListTaskHandlerTest.php80
1 files changed, 80 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Admin/ConfigurationListTaskHandlerTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Admin/ConfigurationListTaskHandlerTest.php
new file mode 100644
index 00000000..93242fe8
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Admin/ConfigurationListTaskHandlerTest.php
@@ -0,0 +1,80 @@
+<?php
+
+namespace SMW\Tests\MediaWiki\Specials\Admin;
+
+use SMW\MediaWiki\Specials\Admin\ConfigurationListTaskHandler;
+use SMW\Tests\TestEnvironment;
+
+/**
+ * @covers \SMW\MediaWiki\Specials\Admin\ConfigurationListTaskHandler
+ * @group semantic-mediawiki
+ *
+ * @license GNU GPL v2+
+ * @since 2.5
+ *
+ * @author mwjames
+ */
+class ConfigurationListTaskHandlerTest extends \PHPUnit_Framework_TestCase {
+
+ private $testEnvironment;
+ private $store;
+ private $outputFormatter;
+
+ protected function setUp() {
+ parent::setUp();
+
+ $this->testEnvironment = new TestEnvironment();
+
+ $this->store = $this->getMockBuilder( '\SMW\Store' )
+ ->disableOriginalConstructor()
+ ->getMockForAbstractClass();
+
+ $this->outputFormatter = $this->getMockBuilder( '\SMW\MediaWiki\Specials\Admin\OutputFormatter' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->testEnvironment->registerObject( 'Store', $this->store );
+ }
+
+ protected function tearDown() {
+ $this->testEnvironment->tearDown();
+ parent::tearDown();
+ }
+
+ public function testCanConstruct() {
+
+ $this->assertInstanceOf(
+ ConfigurationListTaskHandler::class,
+ new ConfigurationListTaskHandler( $this->outputFormatter )
+ );
+ }
+
+ public function testGetHtml() {
+
+ $instance = new ConfigurationListTaskHandler(
+ $this->outputFormatter
+ );
+
+ $this->assertInternalType(
+ 'string',
+ $instance->getHtml()
+ );
+ }
+
+ public function testHandleRequest() {
+
+ $this->outputFormatter->expects( $this->atLeastOnce() )
+ ->method( 'addHtml' );
+
+ $instance = new ConfigurationListTaskHandler(
+ $this->outputFormatter
+ );
+
+ $webRequest = $this->getMockBuilder( '\WebRequest' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $instance->handleRequest( $webRequest );
+ }
+
+}