summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/FixtureProperty.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/FixtureProperty.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/FixtureProperty.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/FixtureProperty.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/FixtureProperty.php
new file mode 100644
index 00000000..430a6841
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/FixtureProperty.php
@@ -0,0 +1,50 @@
+<?php
+
+namespace SMW\Tests\Utils\Fixtures\Properties;
+
+use SMW\DataValueFactory;
+use SMW\DIProperty;
+use SMW\SemanticData;
+
+/**
+ * @license GNU GPL v2+
+ * @since 2.1
+ *
+ * @author mwjames
+ */
+abstract class FixtureProperty {
+
+ /**
+ * @var DIProperty
+ */
+ protected $property = null;
+
+ /**
+ * @since 2.1
+ *
+ * @return DIProperty
+ */
+ public function getProperty() {
+ return $this->property;
+ }
+
+ /**
+ * @since 2.1
+ *
+ * @return SemanticData
+ */
+ public function getDependencies() {
+
+ $semanticData = new SemanticData( $this->property->getDiWikiPage() );
+
+ $semanticData->addDataValue(
+ DataValueFactory::getInstance()->newDataValueByProperty(
+ new DIProperty( '_TYPE' ),
+ $this->property->findPropertyTypeID()
+ )
+ );
+
+ return $semanticData;
+ }
+
+}