summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/JsonTestCaseScriptRunnerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/JsonTestCaseScriptRunnerTest.php')
-rw-r--r--www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/JsonTestCaseScriptRunnerTest.php35
1 files changed, 27 insertions, 8 deletions
diff --git a/www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/JsonTestCaseScriptRunnerTest.php b/www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/JsonTestCaseScriptRunnerTest.php
index 458408f4..63e740fc 100644
--- a/www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/JsonTestCaseScriptRunnerTest.php
+++ b/www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/JsonTestCaseScriptRunnerTest.php
@@ -1,9 +1,6 @@
<?php
-
namespace SRF\Tests\Integration\JSONScript;
-
use SMW\Tests\Integration\JSONScript\JsonTestCaseScriptRunnerTest as SMWJsonTestCaseScriptRunnerTest;
-
/**
* @see https://github.com/SemanticMediaWiki/SemanticMediaWiki/tree/master/tests#write-integration-tests-using-json-script
*
@@ -20,7 +17,6 @@ use SMW\Tests\Integration\JSONScript\JsonTestCaseScriptRunnerTest as SMWJsonTest
* @author Stephan Gambke
*/
class JsonTestCaseScriptRunnerTest extends SMWJsonTestCaseScriptRunnerTest {
-
/**
* @see \SMW\Tests\JsonTestCaseScriptRunner::getTestCaseLocation
* @return string
@@ -28,17 +24,40 @@ class JsonTestCaseScriptRunnerTest extends SMWJsonTestCaseScriptRunnerTest {
protected function getTestCaseLocation() {
return __DIR__ . '/TestCases';
}
-
/**
* @return string[]
* @since 3.0
*/
protected function getPermittedSettings() {
$settings = parent::getPermittedSettings();
-
$settings[] = 'srfgMapProvider';
-
return $settings;
}
-}
+ /**
+ * @see JsonTestCaseScriptRunner::getDependencyDefinitions
+ */
+ protected function getDependencyDefinitions() {
+ return [
+ 'Mermaid' => [ $this, 'checkMermaidDependency' ]
+ ];
+ }
+ public function checkMermaidDependency( $val, &$reason ) {
+
+ if ( !defined( 'MERMAID_VERSION' ) ) {
+ $reason = "Dependency: Mermaid as requirement is not available!";
+ return false;
+ }
+
+ list( $compare, $requiredVersion ) = explode( ' ', $val );
+ $version = MERMAID_VERSION;
+
+ if ( !version_compare( $version, $requiredVersion, $compare ) ) {
+ $reason = "Dependency: Required version of Mermaid($requiredVersion $compare $version) is not available!";
+ return false;
+ }
+
+ return true;
+ }
+
+} \ No newline at end of file