diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/SpecialPropertyLabelSimilarityTest.php')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/SpecialPropertyLabelSimilarityTest.php | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/SpecialPropertyLabelSimilarityTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/SpecialPropertyLabelSimilarityTest.php new file mode 100644 index 00000000..d7a5c3df --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Specials/SpecialPropertyLabelSimilarityTest.php @@ -0,0 +1,54 @@ +<?php + +namespace SMW\Tests\MediaWiki\Specials; + +use SMW\MediaWiki\Specials\SpecialPropertyLabelSimilarity; +use SMW\Tests\TestEnvironment; +use Title; + +/** + * @covers \SMW\MediaWiki\Specials\SpecialPropertyLabelSimilarity + * @group semantic-mediawiki + * + * @license GNU GPL v2+ + * @since 2.5 + * + * @author mwjames + */ +class SpecialPropertyLabelSimilarityTest extends \PHPUnit_Framework_TestCase { + + private $testEnvironment; + private $stringValidator; + + protected function setUp() { + parent::setUp(); + + $this->testEnvironment = new TestEnvironment(); + + $store = $this->getMockBuilder( '\SMW\Store' ) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->testEnvironment->registerObject( 'Store', $store ); + $this->stringValidator = $this->testEnvironment->getUtilityFactory()->newValidatorFactory()->newStringValidator(); + } + + protected function tearDown() { + $this->testEnvironment->tearDown(); + parent::tearDown(); + } + + public function testCanExecute() { + + $instance = new SpecialPropertyLabelSimilarity(); + + $instance->getContext()->setTitle( + Title::newFromText( 'SpecialPropertyLabelSimilarity' ) + ); + + $this->assertTrue( + $instance->execute( '' ) + ); + } + +} |