dataItemFactory = new DataItemFactory(); $this->testEnvironment = new TestEnvironment(); $this->testEnvironment->resetPoolCacheById( \SMWExporter::POOLCACHE_ID ); } protected function tearDown(): void { $this->testEnvironment->tearDown(); parent::tearDown(); } public function testCanConstruct() { $this->assertInstanceof( PredefinedPropertyValueResourceBuilder::class, new PredefinedPropertyValueResourceBuilder() ); } public function testIsNotResourceBuilderForUserDefinedProperty() { $property = $this->dataItemFactory->newDIProperty( 'Foo' ); $instance = new PredefinedPropertyValueResourceBuilder(); $this->assertFalse( $instance->isResourceBuilderFor( $property ) ); } public function testAddResourceValueForPredefinedProperty() { $property = $this->dataItemFactory->newDIProperty( '_boo' ); $dataItem = $this->dataItemFactory->newDIBoolean( true ); $expData = new ExpData( new ExpNsResource( 'Foobar', 'Bar', 'Mo', null ) ); $instance = new PredefinedPropertyValueResourceBuilder(); $instance->addResourceValue( $expData, $property, $dataItem ); $this->assertTrue( $instance->isResourceBuilderFor( $property ) ); } }