diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-07-15 15:33:36 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-07-15 15:33:36 -0300 |
commit | a5f917bbc55e295896b8084f6657eb8b6abaf8a8 (patch) | |
tree | 83dca14378e45b11fe6bbf1d17e64505dff43cbd /extensions/TimedMediaHandler/tests/phpunit/TestTimedMediaHandler.php | |
parent | a1d705e541e0d10baa6bb03935ffd38d9478d0e6 (diff) |
Add TimedMediaHandler extension that allows display audio and video files in wiki pages, using the same syntax as for image files
Diffstat (limited to 'extensions/TimedMediaHandler/tests/phpunit/TestTimedMediaHandler.php')
-rw-r--r-- | extensions/TimedMediaHandler/tests/phpunit/TestTimedMediaHandler.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/extensions/TimedMediaHandler/tests/phpunit/TestTimedMediaHandler.php b/extensions/TimedMediaHandler/tests/phpunit/TestTimedMediaHandler.php new file mode 100644 index 00000000..2ca350a0 --- /dev/null +++ b/extensions/TimedMediaHandler/tests/phpunit/TestTimedMediaHandler.php @@ -0,0 +1,47 @@ +<?php +class TestTimedMediaHandler extends MediaWikiTestCase { + + /** @var TimedMediaHandler */ + private $handler; + + function setUp() { + $this->handler = new TimedMediaHandler; + parent::setUp(); + } + + /** + * @dataProvider providerParseParamString + * @param $str String a thumbnail parameter string + * @param $expected Array Expected thumbnailing parameters + */ + function testParseParamString( $str, $expected ) { + $result = $this->handler->parseParamString( $str ); + $this->assertEquals( $result, $expected ); + } + + function providerParseParamString() { + return array( + array( + 'mid', + array(), + ), + array( + '220px-', + array( 'width' => 220 ), + ), + array( + 'seek=30', + array( 'thumbtime' => 30.0 ), + ), + array( + 'seek=15.72', + array( 'thumbtime' => 15.72 ), + ), + array( + '180px-seek=15', + array( 'thumbtime' => 15, 'width' => 180 ), + ), + ); + + } +} |