jenkins-bot has submitted this change and it was merged.

Change subject: Add missing test cases to RdfWriterFactoryTest
......................................................................


Add missing test cases to RdfWriterFactoryTest

Change-Id: Ib6d2e509879f76674b33fbe7d868380afaa6b4f4
---
M purtle/tests/phpunit/RdfWriterFactoryTest.php
1 file changed, 24 insertions(+), 0 deletions(-)

Approvals:
  Aude: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/purtle/tests/phpunit/RdfWriterFactoryTest.php 
b/purtle/tests/phpunit/RdfWriterFactoryTest.php
index 9ac996f..af8bc03 100644
--- a/purtle/tests/phpunit/RdfWriterFactoryTest.php
+++ b/purtle/tests/phpunit/RdfWriterFactoryTest.php
@@ -11,6 +11,7 @@
  *
  * @licence GNU GPL v2+
  * @author Daniel Kinzler
+ * @author Thiemo Mättig
  */
 class RdfWriterFactoryTest extends \MediaWikiTestCase {
 
@@ -33,6 +34,12 @@
                }
        }
 
+       public function testGivenInvalidFormat_getWriterThrowsException() {
+               $factory = new RdfWriterFactory();
+               $this->setExpectedException( 'InvalidArgumentException' );
+               $factory->getWriter( 'invalid' );
+       }
+
        public function testGetFormatName() {
                $factory = new RdfWriterFactory();
 
@@ -42,6 +49,11 @@
                        // the canonical name should just stay
                        $this->assertEquals( $format, $actual );
                }
+       }
+
+       public function testGivenInvalidFormat_getFormatNameReturnsFalse() {
+               $factory = new RdfWriterFactory();
+               $this->assertFalse( $factory->getFormatName( 'invalid' ) );
        }
 
        public function provideFormats() {
@@ -98,6 +110,12 @@
                }
        }
 
+       public function testGivenInvalidFormat_getMimeTypesThrowsException() {
+               $factory = new RdfWriterFactory();
+               $this->setExpectedException( 'InvalidArgumentException' );
+               $factory->getMimeTypes( 'invalid' );
+       }
+
        public function testGetFileExtensions() {
                $factory = new RdfWriterFactory();
 
@@ -108,4 +126,10 @@
                }
        }
 
+       public function 
testGivenInvalidFormat_getFileExtensionsThrowsException() {
+               $factory = new RdfWriterFactory();
+               $this->setExpectedException( 'InvalidArgumentException' );
+               $factory->getFileExtension( 'invalid' );
+       }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/260365
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6d2e509879f76674b33fbe7d868380afaa6b4f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to