semanticData = $this->getMockBuilder( '\SMW\semanticData' ) ->disableOriginalConstructor() ->getMock(); } public function testCanConstruct() { $this->assertInstanceOf( '\SMW\SPARQLStore\ReplicationDataTruncator', new ReplicationDataTruncator() ); } public function testOnEmptyList() { $instance = new ReplicationDataTruncator(); $semanticData = $instance->doTruncate( $this->semanticData ); $this->assertSame( $this->semanticData, $semanticData ); } public function testOnExemptedList() { $property = new DIProperty( 'Foo_bar' ); $this->semanticData->expects( $this->once() ) ->method( 'removeProperty' ) ->with( $property ); $instance = new ReplicationDataTruncator(); $instance->setPropertyExemptionList( [ 'Foo bar' ] ); $instance->doTruncate( $this->semanticData ); } public function testOnExemptedListWithPredefinedProperty() { $property = new DIProperty( '_ASK' ); $this->semanticData->expects( $this->once() ) ->method( 'removeProperty' ) ->with( $property ); $instance = new ReplicationDataTruncator(); $instance->setPropertyExemptionList( [ 'Has query' ] ); $instance->doTruncate( $this->semanticData ); } }