diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/CountryCategory.php')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/CountryCategory.php | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/CountryCategory.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/CountryCategory.php new file mode 100644 index 00000000..2f821be8 --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Fixtures/Properties/CountryCategory.php @@ -0,0 +1,59 @@ +<?php + +namespace SMW\Tests\Utils\Fixtures\Properties; + +use SMW\DataValueFactory; +use SMW\DIProperty; +use SMW\DIWiKiPage; + +/** + * @license GNU GPL v2+ + * @since 2.1 + * + * @author mwjames + */ +class CountryCategory { + + /** + * @var DIProperty + */ + private $property = null; + + /** + * @since 2.1 + */ + public function __construct() { + $this->property = new DIProperty( '_INST' ); + } + + /** + * @since 2.1 + * + * @return DIProperty + */ + public function getProperty() { + return $this->property; + } + + /** + * @since 2.1 + * + * @return DIWiKiPage + */ + public function asSubject() { + return new DIWiKiPage( 'Country', NS_CATEGORY ); + } + + /** + * @since 2.1 + * + * @return DataValue + */ + public function getCategoryValue() { + return DataValueFactory::getInstance()->newDataValueByItem( + $this->asSubject(), + $this->getProperty() + ); + } + +} |