From a5f917bbc55e295896b8084f6657eb8b6abaf8a8 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Fri, 15 Jul 2016 15:33:36 -0300 Subject: Add TimedMediaHandler extension that allows display audio and video files in wiki pages, using the same syntax as for image files --- .../tests/phpunit/TestWebMHandler.php | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 extensions/TimedMediaHandler/tests/phpunit/TestWebMHandler.php (limited to 'extensions/TimedMediaHandler/tests/phpunit/TestWebMHandler.php') diff --git a/extensions/TimedMediaHandler/tests/phpunit/TestWebMHandler.php b/extensions/TimedMediaHandler/tests/phpunit/TestWebMHandler.php new file mode 100644 index 00000000..2d73f46d --- /dev/null +++ b/extensions/TimedMediaHandler/tests/phpunit/TestWebMHandler.php @@ -0,0 +1,52 @@ +handler = new WebMHandler; + } + + /** + * @dataProvider providerGetStreamTypes + * @param $filename String name of file + * @param $expected array List of codecs in file + */ + function testGetStreamTypes( $filename, $expected ) { + $testFile = $this->dataFile( $filename, 'video/webm' ); + $this->assertEquals( $expected, $this->handler->getStreamTypes( $testFile ) ); + } + + function providerGetStreamTypes() { + return array( + array( 'shuttle10seconds.1080x608.webm', array( 'VP8' ) ), + array( 'VP9-tractor.webm', array( 'VP9' ) ), + array( 'bear-vp9-opus.webm', array( 'Opus', 'VP9' ) ) + ); + } + + + /** + * @dataProvider providerGetWebType + * @param $filename String name of file + * @param $expected String Mime type + */ + function testGetWebType( $filename, $expected ) { + $testFile = $this->dataFile( $filename, 'video/webm' ); + $this->assertEquals( $expected, $this->handler->getWebType( $testFile ) ); + } + + function providerGetWebType() { + return array( + array( 'shuttle10seconds.1080x608.webm', 'video/webm; codecs="vp8"' ), + array( 'VP9-tractor.webm', 'video/webm; codecs="vp9"' ), + array( 'bear-vp9-opus.webm', 'video/webm; codecs="opus, vp9"' ) + ); + } +} -- cgit v1.2.3-54-g00ecf