Daniel Kinzler has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/345384 )
Change subject: Add sanity check for data model version to rdf tests
......................................................................
Add sanity check for data model version to rdf tests
Change-Id: I3e47e38ca57d5f85b337d8ecab46c3953665027d
---
M repo/tests/phpunit/includes/Rdf/RdfBuilderTestData.php
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/84/345384/1
diff --git a/repo/tests/phpunit/includes/Rdf/RdfBuilderTestData.php
b/repo/tests/phpunit/includes/Rdf/RdfBuilderTestData.php
index 070a585..9e27af7 100644
--- a/repo/tests/phpunit/includes/Rdf/RdfBuilderTestData.php
+++ b/repo/tests/phpunit/includes/Rdf/RdfBuilderTestData.php
@@ -3,6 +3,7 @@
namespace Wikibase\Repo\Tests\Rdf;
use InvalidArgumentException;
+use RuntimeException;
use Site;
use SiteList;
use Wikibase\DataModel\Entity\EntityDocument;
@@ -54,6 +55,13 @@
* @param string $dataDir directory containing RDF data (n-triples
files)
*/
public function __construct( $entityDir, $dataDir ) {
+ // NOTE: this is a sanity check to avoid confusion when
manually running unit tests
+ // in an environment that may have inconsistent library
versions, such as a development
+ // setup.
+ if ( !preg_match( '/^7\./', WIKIBASE_DATAMODEL_VERSION ) ) {
+ throw new RuntimeException( 'RDF test data requires
data-model version 7!' );
+ }
+
$this->entityDir = $entityDir;
$this->dataDir = $dataDir;
}
--
To view, visit https://gerrit.wikimedia.org/r/345384
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e47e38ca57d5f85b337d8ecab46c3953665027d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits