diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/BookRecordProperty.php')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/BookRecordProperty.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/BookRecordProperty.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/BookRecordProperty.php new file mode 100644 index 00000000..ecc13f11 --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/BookRecordProperty.php @@ -0,0 +1,50 @@ +<?php + +namespace SMW\Tests\Utils\Fixtures\Properties; + +use SMW\DIProperty; +use SMW\SemanticData; +use SMWDIBlob as DIBlob; + +/** + * Simplified book record + * + * @license GNU GPL v2+ + * @since 2.1 + * + * @author mwjames + */ +class BookRecordProperty extends FixtureProperty { + + /** + * @since 2.1 + */ + public function __construct() { + $this->property = DIProperty::newFromUserLabel( 'Book record' ); + $this->property->setPropertyTypeId( '_rec' ); + } + + /** + * @since 2.1 + * + * @return SemanticData + */ + public function getDependencies() { + + $semanticData = parent::getDependencies(); + + $titleProperty = new TitleProperty(); + $yearProperty = new YearProperty(); + + $semanticData->addPropertyObjectValue( + new DIProperty( '_LIST' ), + new DIBlob( + $titleProperty->getProperty()->getKey() . ';' . + $yearProperty->getProperty()->getKey() + ) + ); + + return $semanticData; + } + +} |