summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/Exception/BadHttpEndpointResponseExceptionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/Exception/BadHttpEndpointResponseExceptionTest.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/Exception/BadHttpEndpointResponseExceptionTest.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/Exception/BadHttpEndpointResponseExceptionTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/Exception/BadHttpEndpointResponseExceptionTest.php
new file mode 100644
index 00000000..54355886
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SPARQLStore/Exception/BadHttpEndpointResponseExceptionTest.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace SMW\Tests\SPARQLStore\Exception;
+
+use SMW\SPARQLStore\Exception\BadHttpEndpointResponseException;
+
+/**
+ * @covers \SMW\SPARQLStore\Exception\BadHttpEndpointResponseException
+ * @group semantic-mediawiki
+ *
+ * @license GNU GPL v2+
+ * @since 2.0
+ *
+ * @author mwjames
+ */
+class BadHttpEndpointResponseExceptionTest extends \PHPUnit_Framework_TestCase {
+
+ public function testCanConstruct() {
+
+ $this->assertInstanceOf(
+ '\SMW\SPARQLStore\Exception\BadHttpEndpointResponseException',
+ new BadHttpEndpointResponseException( 'Foo', 'Bar', 'Que' )
+ );
+ }
+
+ /**
+ * @dataProvider errorCodeProvider
+ */
+ public function testErrorCodes( $errorCode ) {
+
+ $instance = new BadHttpEndpointResponseException( $errorCode, '', '' );
+ $this->assertEquals( $errorCode, $instance->getCode() );
+ }
+
+ public function errorCodeProvider() {
+
+ $provider = [
+ [ BadHttpEndpointResponseException::ERROR_MALFORMED ],
+ [ BadHttpEndpointResponseException::ERROR_REFUSED ],
+ [ BadHttpEndpointResponseException::ERROR_GRAPH_NOEXISTS ],
+ [ BadHttpEndpointResponseException::ERROR_GRAPH_EXISTS ],
+ [ BadHttpEndpointResponseException::ERROR_OTHER ],
+ [ BadHttpEndpointResponseException::ERROR_NOSERVICE ]
+ ];
+
+ return $provider;
+ }
+
+}