summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Hooks/HookHandlerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Hooks/HookHandlerTest.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Hooks/HookHandlerTest.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Hooks/HookHandlerTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Hooks/HookHandlerTest.php
new file mode 100644
index 00000000..38f4635c
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/MediaWiki/Hooks/HookHandlerTest.php
@@ -0,0 +1,50 @@
+<?php
+
+namespace SMW\Tests\MediaWiki\Hooks;
+
+use SMW\MediaWiki\Hooks\HookHandler;
+
+/**
+ * @covers \SMW\MediaWiki\Hooks\HookHandler
+ * @group semantic-mediawiki
+ *
+ * @license GNU GPL v2+
+ * @since 3.0
+ *
+ * @author mwjames
+ */
+class HookHandlerTest extends \PHPUnit_Framework_TestCase {
+
+ public function testCanConstruct() {
+
+ $this->assertInstanceOf(
+ HookHandler::class,
+ new HookHandler()
+ );
+ }
+
+ public function testOptions() {
+
+ $instance = new HookHandler();
+
+ $this->assertNull(
+ $instance->getOption( 'Foo' )
+ );
+
+ $this->assertFalse(
+ $instance->getOption( 'Foo', false )
+ );
+
+ $instance->setOptions( [ 'Foo' => 42 ] );
+
+ $this->assertEquals(
+ 42,
+ $instance->getOption( 'Foo' )
+ );
+
+ $this->assertTrue(
+ $instance->isFlagSet( 'Foo', 42 )
+ );
+ }
+
+}