summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Ask/LinksWidgetTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Ask/LinksWidgetTest.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Ask/LinksWidgetTest.php133
1 files changed, 133 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Ask/LinksWidgetTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Ask/LinksWidgetTest.php
new file mode 100644
index 00000000..152d494a
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/Ask/LinksWidgetTest.php
@@ -0,0 +1,133 @@
+<?php
+
+namespace SMW\Tests\MediaWiki\Specials\Ask;
+
+use SMW\MediaWiki\Specials\Ask\LinksWidget;
+
+/**
+ * @covers \SMW\MediaWiki\Specials\Ask\LinksWidget
+ * @group semantic-mediawiki
+ *
+ * @license GNU GPL v2+
+ * @since 2.5
+ *
+ * @author mwjames
+ */
+class LinksWidgetTest extends \PHPUnit_Framework_TestCase {
+
+ public function testFieldset() {
+
+ $this->assertInternalType(
+ 'string',
+ LinksWidget::fieldset()
+ );
+ }
+
+ public function testEmbeddedCodeLink() {
+
+ $this->assertInternalType(
+ 'string',
+ LinksWidget::embeddedCodeLink()
+ );
+ }
+
+ public function testEmbeddedCodeBlock() {
+
+ $this->assertInternalType(
+ 'string',
+ LinksWidget::embeddedCodeBlock( 'Foo' )
+ );
+ }
+
+ public function testResultSubmitLinkHide() {
+
+ $this->assertInternalType(
+ 'string',
+ LinksWidget::resultSubmitLink( true )
+ );
+ }
+
+ public function testResultSubmitLinkShow() {
+
+ $this->assertInternalType(
+ 'string',
+ LinksWidget::resultSubmitLink( false )
+ );
+ }
+
+ public function testShowHideLink() {
+
+ $title = $this->getMockBuilder( '\Title' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $urlArgs = $this->getMockBuilder( '\SMW\MediaWiki\Specials\Ask\UrlArgs' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->assertInternalType(
+ 'string',
+ LinksWidget::showHideLink( $title, $urlArgs )
+ );
+ }
+
+ public function testDebugLink() {
+
+ $title = $this->getMockBuilder( '\Title' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $urlArgs = $this->getMockBuilder( '\SMW\MediaWiki\Specials\Ask\UrlArgs' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->assertInternalType(
+ 'string',
+ LinksWidget::debugLink( $title, $urlArgs )
+ );
+ }
+
+ public function testNoQCacheLink() {
+
+ $title = $this->getMockBuilder( '\Title' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $urlArgs = $this->getMockBuilder( '\SMW\MediaWiki\Specials\Ask\UrlArgs' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->assertInternalType(
+ 'string',
+ LinksWidget::noQCacheLink( $title, $urlArgs, true )
+ );
+ }
+
+ public function testNoQCacheLinkOnFalseFromCache() {
+
+ $title = $this->getMockBuilder( '\Title' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $urlArgs = $this->getMockBuilder( '\SMW\MediaWiki\Specials\Ask\UrlArgs' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->assertEmpty(
+ LinksWidget::noQCacheLink( $title, $urlArgs, false )
+ );
+ }
+
+ public function testClipboardLink() {
+
+ $infolink = $this->getMockBuilder( '\SMWInfolink' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->assertInternalType(
+ 'string',
+ LinksWidget::clipboardLink( $infolink )
+ );
+ }
+
+}