From ba9ed55beaf52fab6a003861eee051b0af1f555d Mon Sep 17 00:00:00 2001 From: mwjames Date: Fri, 29 Apr 2016 06:22:37 +0200 Subject: [PATCH] Tidy --- SemanticMediaWiki.php | 1 + includes/SemanticData.php | 23 +--------- includes/datavalues/SMW_DV_Property.php | 23 +--------- includes/datavalues/SMW_DV_WikiPage.php | 2 +- includes/storage/StoreFactory.php | 17 ------- src/ApplicationFactory.php | 13 +++++- src/CacheFactory.php | 27 +++++++++++ .../UniquenessConstraintValueValidator.php | 11 ++--- src/HashBuilder.php | 45 +++++++++++++++++-- .../Hooks/NewRevisionFromEditComplete.php | 18 +++++--- src/SQLStore/SQLStoreFactory.php | 21 ++------- src/SharedCallbackContainer.php | 11 ++--- tests/phpunit/Unit/CacheFactoryTest.php | 10 +++++ tests/phpunit/Unit/HashBuilderTest.php | 13 ++++++ tests/phpunit/includes/SemanticDataTest.php | 35 ++++++++------- .../includes/storage/StoreFactoryTest.php | 14 ------ .../sqlstore/Sql3StubSemanticDataTest.php | 20 ++++++--- 17 files changed, 169 insertions(+), 135 deletions(-) diff --git a/SemanticMediaWiki.php b/SemanticMediaWiki.php index b7bbfd1273..173fa6ebdc 100644 --- a/SemanticMediaWiki.php +++ b/SemanticMediaWiki.php @@ -115,6 +115,7 @@ class_alias( 'SMW\ParameterProcessorFactory', 'SMW\ParameterFormatterFactory' ); // 2.4 class_alias( 'SMW\RequestOptions', 'SMWRequestOptions' ); class_alias( 'SMW\StringCondition', 'SMWStringCondition' ); +class_alias( 'SMW\HashBuilder', 'SMW\Hash' ); // A flag used to indicate SMW defines a semantic extension type for extension credits. // @deprecated, removal in SMW 3.0 diff --git a/includes/SemanticData.php b/includes/SemanticData.php index adb564f738..4af1c054f5 100644 --- a/includes/SemanticData.php +++ b/includes/SemanticData.php @@ -268,28 +268,7 @@ public function getHash() { return $this->hash; } - $hash = array(); - - $hash[] = $this->mSubject->getSerialization(); - - foreach ( $this->getProperties() as $property ) { - $hash[] = $property->getKey(); - - foreach ( $this->getPropertyValues( $property ) as $di ) { - $hash[] = $di->getSerialization(); - } - } - - foreach ( $this->getSubSemanticData() as $data ) { - $hash[] = $data->getHash(); - } - - sort( $hash ); - - $this->hash = md5( implode( '#', $hash ) ); - unset( $hash ); - - return $this->hash; + return $this->hash = Hash::createFromSemanticData( $this ); } /** diff --git a/includes/datavalues/SMW_DV_Property.php b/includes/datavalues/SMW_DV_Property.php index 4248247e15..58fce6f404 100644 --- a/includes/datavalues/SMW_DV_Property.php +++ b/includes/datavalues/SMW_DV_Property.php @@ -143,7 +143,7 @@ protected function parseUserValue( $value ) { } // @see the SMW_DV_PROV_DTITLE explanation - if ( $this->canFindPropertyByDisplayTitle() ) { + if ( $this->isEnabledFeature( SMW_DV_PROV_DTITLE ) ) { $dataItem = $this->getPropertySpecificationLookup()->getPropertyFromDisplayTitle( $value ); @@ -153,7 +153,7 @@ protected function parseUserValue( $value ) { $this->inceptiveProperty = $this->m_dataitem; - if ( $this->canFindPropertyRedirect() ) { + if ( $this->isEnabledFeature( SMW_DV_PROV_REDI ) ) { $this->m_dataitem = $this->m_dataitem->getRedirectTarget(); } } @@ -350,25 +350,6 @@ protected function highlightText( $text, $linker = null ) { return $text; } - - /** - * @since 2.4 - * - * @return boolean - */ - protected function canFindPropertyRedirect() { - return ( $this->getOptionValueFor( 'smwgDVFeatures' ) & SMW_DV_PROV_REDI ) != 0; - } - - /** - * @since 2.4 - * - * @return boolean - */ - protected function canFindPropertyByDisplayTitle() { - return ( $this->getOptionValueFor( 'smwgDVFeatures' ) & SMW_DV_PROV_DTITLE ) != 0; - } - /** * A function for registering/overwriting predefined properties for SMW. Should be called from * within the hook 'smwInitProperties'. Ids should start with three underscores "___" to avoid diff --git a/includes/datavalues/SMW_DV_WikiPage.php b/includes/datavalues/SMW_DV_WikiPage.php index 3a54fd5746..24882783d8 100644 --- a/includes/datavalues/SMW_DV_WikiPage.php +++ b/includes/datavalues/SMW_DV_WikiPage.php @@ -557,7 +557,7 @@ protected function getWikiLinkTarget() { * @return string sortkey */ public function getSortKey() { - return \SMW\StoreFactory::getStore()->getWikiPageSortKey( $this->m_dataitem ); + return ApplicationFactory::getInstance()->getStore()->getWikiPageSortKey( $this->m_dataitem ); } /** diff --git a/includes/storage/StoreFactory.php b/includes/storage/StoreFactory.php index 1265a4a44e..ac1be3243f 100644 --- a/includes/storage/StoreFactory.php +++ b/includes/storage/StoreFactory.php @@ -50,23 +50,6 @@ public static function getStore( $store = null ) { return self::$instance[$store]; } - /** - * @note This method should not be used in production code and is mostly - * provided to inject instances during unit testing - * - * @since 2.0 - * - * @param Store $instance - */ - public static function setDefaultStoreForUnitTest( Store $instance ) { - - if ( self::$defaultStore === null ) { - self::$defaultStore = self::getConfiguration()->get( 'smwgDefaultStore' ); - } - - self::$instance[self::$defaultStore] = $instance; - } - /** * @since 1.9 */ diff --git a/src/ApplicationFactory.php b/src/ApplicationFactory.php index b72cac9838..f2986dc5e0 100644 --- a/src/ApplicationFactory.php +++ b/src/ApplicationFactory.php @@ -89,6 +89,17 @@ public function registerObject( $objectName, $objectSignature ) { $this->callbackLoader->registerObject( $objectName, $objectSignature ); } + /** + * @private + * + * @since 2.4 + * + * @return CallbackLoader + */ + public function getCallbackInstantiator() { + return $this->callbackLoader; + } + /** * @since 2.0 * @@ -160,7 +171,7 @@ public function newMaintenanceFactory() { * @return CacheFactory */ public function newCacheFactory() { - return new CacheFactory( $this->getSettings()->get( 'smwgCacheType' ) ); + return $this->callbackLoader->load( 'CacheFactory', $this->getSettings()->get( 'smwgCacheType' ) ); } /** diff --git a/src/CacheFactory.php b/src/CacheFactory.php index 6c805a6fba..45144d88f7 100644 --- a/src/CacheFactory.php +++ b/src/CacheFactory.php @@ -19,12 +19,18 @@ class CacheFactory { */ private $mainCacheType; + /** + * @var CallbackInstantiator + */ + private $callbackInstantiator; + /** * @since 2.2 * * @param string|integer|null $mainCacheType */ public function __construct( $mainCacheType = null ) { + $this->callbackInstantiator = ApplicationFactory::getInstance()->getCallbackInstantiator(); $this->mainCacheType = $mainCacheType; if ( $this->mainCacheType === null ) { @@ -130,4 +136,25 @@ public function newMediaWikiCompositeCache( $mediaWikiCacheType = null ) { return $compositeCache; } + /** + * @since 2.4 + * + * @param string $namespace + * @param string|integer|null $cacheType + * @param integer $cacheLifetime + * + * @return BlobStore + */ + public function newBlobStore( $namespace, $cacheType = null, $cacheLifetime = 0 ) { + + $blobStore = $this->callbackInstantiator->load( 'BlobStore', $namespace, $cacheType, $cacheLifetime ); + + // If CACHE_NONE is selected, disable the usage + $blobStore->setUsageState( + $cacheType !== CACHE_NONE + ); + + return $blobStore; + } + } diff --git a/src/DataValues/ValueValidators/UniquenessConstraintValueValidator.php b/src/DataValues/ValueValidators/UniquenessConstraintValueValidator.php index 3a3e2a7633..087392cc5b 100644 --- a/src/DataValues/ValueValidators/UniquenessConstraintValueValidator.php +++ b/src/DataValues/ValueValidators/UniquenessConstraintValueValidator.php @@ -79,14 +79,10 @@ public function validate( $dataValue ) { $this->hasConstraintViolation = false; - if ( - !$dataValue instanceof DataValue || - $dataValue->getContextPage() === null || - !$dataValue->isEnabledFeature( SMW_DV_PVUC ) ) { + if ( !$this->canValidate( $dataValue ) ) { return $this->hasConstraintViolation; } - $dataItem = $dataValue->getDataItem(); $property = $dataValue->getProperty(); if ( !$dataValue->getPropertySpecificationLookup()->hasUniquenessConstraintFor( $property ) ) { @@ -94,6 +90,7 @@ public function validate( $dataValue ) { } $blobStore = $this->cachedPropertyValuesPrefetcher->getBlobStore(); + $dataItem = $dataValue->getDataItem(); $hash = $this->cachedPropertyValuesPrefetcher->getHashFor( $property->getKey() . ':' . $dataItem->getHash() @@ -185,4 +182,8 @@ private function tryFindMatchResultFor( $hash, $dataValue ) { return $page; } + private function canValidate( $dataValue ) { + return $dataValue instanceof DataValue && $dataValue->getContextPage() !== null && $dataValue->isEnabledFeature( SMW_DV_PVUC ); + } + } diff --git a/src/HashBuilder.php b/src/HashBuilder.php index 8bf1bb1c14..4e85f5023e 100644 --- a/src/HashBuilder.php +++ b/src/HashBuilder.php @@ -14,6 +14,35 @@ */ class HashBuilder { + /** + * @since 2.4 + * + * @param SemanticData $semanticData + * + * @return string + */ + public static function createFromSemanticData( SemanticData $semanticData ) { + + $hash = array(); + $hash[] = $semanticData->getSubject()->getSerialization(); + + foreach ( $semanticData->getProperties() as $property ) { + $hash[] = $property->getKey(); + + foreach ( $semanticData->getPropertyValues( $property ) as $di ) { + $hash[] = $di->getSerialization(); + } + } + + foreach ( $semanticData->getSubSemanticData() as $data ) { + $hash[] = $data->getHash(); + } + + sort( $hash ); + + return md5( implode( '#', $hash ) ); + } + /** * @since 2.1 * @@ -32,6 +61,16 @@ public static function createHashIdForContent( $hashableContent, $prefix = '' ) } /** + * @since 2.4 + * + * @return string + */ + public static function createFromSegments( /* args */ ) { + return implode( '#', func_get_args() ); + } + + /** + * @deprecated since 2.4, use Hash::createFromSegments * @since 2.1 * * @param string $title @@ -42,7 +81,7 @@ public static function createHashIdForContent( $hashableContent, $prefix = '' ) * @return string */ public static function createHashIdFromSegments( $title, $namespace, $interwiki = '', $fragment = '' ) { - return "$title#$namespace#$interwiki#$fragment"; + return self::createFromSegments( $title, $namespace, $interwiki, $fragment ); } /** @@ -53,7 +92,7 @@ public static function createHashIdFromSegments( $title, $namespace, $interwiki * @return string */ public static function getHashIdForTitle( Title $title ) { - return self::createHashIdFromSegments( + return self::createFromSegments( $title->getDBKey(), $title->getNamespace(), $title->getInterwiki(), @@ -69,7 +108,7 @@ public static function getHashIdForTitle( Title $title ) { * @return string */ public static function getHashIdForDiWikiPage( DIWikiPage $dataItem ) { - return self::createHashIdFromSegments( + return self::createFromSegments( $dataItem->getDBKey(), $dataItem->getNamespace(), $dataItem->getInterwiki(), diff --git a/src/MediaWiki/Hooks/NewRevisionFromEditComplete.php b/src/MediaWiki/Hooks/NewRevisionFromEditComplete.php index 5549d55c79..45c476eae3 100644 --- a/src/MediaWiki/Hooks/NewRevisionFromEditComplete.php +++ b/src/MediaWiki/Hooks/NewRevisionFromEditComplete.php @@ -72,15 +72,23 @@ public function __construct( $wikiPage, $revision, $baseId, $user = null ) { * @return boolean */ public function process() { - return $this->getParserOutputFromEditInfo() instanceof ParserOutput ? $this->performUpdate() : true; + return $this->canUseParserOutputFromEditInfo() ? $this->doProcess() : true; } - protected function getParserOutputFromEditInfo() { - $editInfoProvider = new EditInfoProvider( $this->wikiPage, $this->revision, $this->user ); - return $this->parserOutput = $editInfoProvider->fetchEditInfo()->getOutput(); + private function canUseParserOutputFromEditInfo() { + + $editInfoProvider = new EditInfoProvider( + $this->wikiPage, + $this->revision, + $this->user + ); + + $this->parserOutput = $editInfoProvider->fetchEditInfo()->getOutput(); + + return $this->parserOutput instanceof ParserOutput; } - protected function performUpdate() { + private function doProcess() { $applicationFactory = ApplicationFactory::getInstance(); $title = $this->wikiPage->getTitle(); diff --git a/src/SQLStore/SQLStoreFactory.php b/src/SQLStore/SQLStoreFactory.php index cd4bc051c3..a89bb4e3d1 100644 --- a/src/SQLStore/SQLStoreFactory.php +++ b/src/SQLStore/SQLStoreFactory.php @@ -2,7 +2,6 @@ namespace SMW\SQLStore; -use Onoi\BlobStore\BlobStore; use SMW\ApplicationFactory; use SMW\CircularReferenceGuard; use SMW\DIProperty; @@ -238,22 +237,10 @@ public function newCachedValueLookupStore() { $cacheFactory = ApplicationFactory::getInstance()->newCacheFactory(); - $blobStore = new BlobStore( + $blobStore = $cacheFactory->newBlobStore( 'smw:vl:store', - $cacheFactory->newMediaWikiCompositeCache( $GLOBALS['smwgValueLookupCacheType'] ) - ); - - // If CACHE_NONE is selected, disable the usage - $blobStore->setUsageState( - $GLOBALS['smwgValueLookupCacheType'] !== CACHE_NONE - ); - - $blobStore->setExpiryInSeconds( - $GLOBALS['smwgValueLookupCacheLifetime'] - ); - - $blobStore->setNamespacePrefix( - $cacheFactory->getCachePrefix() + $this->settings->get( 'smwgValueLookupCacheType' ), + $this->settings->get( 'smwgValueLookupCacheLifetime' ) ); $cachedValueLookupStore = new CachedValueLookupStore( @@ -262,7 +249,7 @@ public function newCachedValueLookupStore() { ); $cachedValueLookupStore->setValueLookupFeatures( - $GLOBALS['smwgValueLookupFeatures'] + $this->settings->get( 'smwgValueLookupFeatures' ) ); $cachedValueLookupStore->setCircularReferenceGuard( diff --git a/src/SharedCallbackContainer.php b/src/SharedCallbackContainer.php index 3ad52eb590..1f88e26553 100644 --- a/src/SharedCallbackContainer.php +++ b/src/SharedCallbackContainer.php @@ -39,14 +39,14 @@ private function registerCallbackHandlers( $callbackLoader ) { $callbackLoader->registerExpectedReturnType( 'Store', '\SMW\Store' ); - $callbackLoader->registerCallback( 'Store', function() use ( $callbackLoader ) { + $callbackLoader->registerCallback( 'Store', function( $store = null ) use ( $callbackLoader ) { return StoreFactory::getStore( $callbackLoader->singleton( 'Settings' )->get( 'smwgDefaultStore' ) ); } ); $callbackLoader->registerExpectedReturnType( 'CacheFactory', '\SMW\CacheFactory' ); - $callbackLoader->registerCallback( 'CacheFactory', function() { - return new CacheFactory(); + $callbackLoader->registerCallback( 'CacheFactory', function( $mainCacheType = null ) { + return new CacheFactory( $mainCacheType ); } ); $callbackLoader->registerExpectedReturnType( 'Cache', '\Onoi\Cache\Cache' ); @@ -134,12 +134,9 @@ private function registerCallbackHandlersByFactory( $callbackLoader ) { return $blobStore; } ); - $callbackLoader->registerCallback( 'CachedPropertyValuesPrefetcher', function() use ( $callbackLoader ) { + $callbackLoader->registerCallback( 'CachedPropertyValuesPrefetcher', function( $cacheType = null, $ttl = 604800 ) use ( $callbackLoader ) { $callbackLoader->registerExpectedReturnType( 'CachedPropertyValuesPrefetcher', '\SMW\CachedPropertyValuesPrefetcher' ); - $cacheType = null; - $ttl = 604800; // 7 * 24 * 3600 - $cachedPropertyValuesPrefetcher = new CachedPropertyValuesPrefetcher( $callbackLoader->load( 'Store' ), $callbackLoader->load( 'BlobStore', 'smw:pvp:store', $cacheType, $ttl ) diff --git a/tests/phpunit/Unit/CacheFactoryTest.php b/tests/phpunit/Unit/CacheFactoryTest.php index 10ddcec861..3573651135 100644 --- a/tests/phpunit/Unit/CacheFactoryTest.php +++ b/tests/phpunit/Unit/CacheFactoryTest.php @@ -110,4 +110,14 @@ public function testCanConstructMediaWikiCompositeCache() { ); } + public function testCanConstructBlobStore() { + + $instance = new CacheFactory( 'hash' ); + + $this->assertInstanceOf( + 'Onoi\BlobStore\BlobStore', + $instance->newBlobStore( 'foo', CACHE_NONE ) + ); + } + } diff --git a/tests/phpunit/Unit/HashBuilderTest.php b/tests/phpunit/Unit/HashBuilderTest.php index 1292b948fa..090f46ebbb 100644 --- a/tests/phpunit/Unit/HashBuilderTest.php +++ b/tests/phpunit/Unit/HashBuilderTest.php @@ -5,6 +5,7 @@ use SMW\DIProperty; use SMW\DIWikiPage; use SMW\HashBuilder; +use SMW\SemanticData; use Title; /** @@ -90,6 +91,18 @@ public function testContentHashId() { ); } + public function testCreateFromSemanticData() { + + $semanticData = new SemanticData( + DIWikiPage::newFromText( __METHOD__ ) + ); + + $this->assertInternalType( + 'string', + HashBuilder::createFromSemanticData( $semanticData ) + ); + } + public function segmentProvider() { $provider[] = array( NS_FILE, 'ichi', '', '' ); diff --git a/tests/phpunit/includes/SemanticDataTest.php b/tests/phpunit/includes/SemanticDataTest.php index 01f5ac3a09..b25ef8c159 100644 --- a/tests/phpunit/includes/SemanticDataTest.php +++ b/tests/phpunit/includes/SemanticDataTest.php @@ -7,15 +7,13 @@ use SMW\DIWikiPage; use SMW\Localizer; use SMW\SemanticData; -use SMW\StoreFactory; use SMW\Subobject; -use SMW\Tests\Utils\UtilityFactory; +use SMW\Tests\TestEnvironment; use SMWDITime as DITime; use Title; /** * @covers \SMW\SemanticData - * * @group semantic-mediawiki * * @license GNU GPL v2+ @@ -27,30 +25,34 @@ class SemanticDataTest extends \PHPUnit_Framework_TestCase { private $semanticDataValidator; private $dataValueFactory; + private $testEnvironment; protected function setUp() { parent::setUp(); - // DIProperty::findPropertyTypeID is called during the test - // which itself will access the store and to avoid unnecessary - // DB reads inject a mock - $store = $this->getMockBuilder( '\SMWSQLStore3' ) + $this->testEnvironment = new TestEnvironment(); + + $store = $this->getMockBuilder( '\SMW\SQLStore\SQLStore' ) ->disableOriginalConstructor() ->getMock(); - $this->semanticDataValidator = UtilityFactory::getInstance()->newValidatorFactory()->newSemanticDataValidator(); - $this->dataValueFactory = DataValueFactory::getInstance(); + $store->expects( $this->any() ) + ->method( 'getRedirectTarget' ) + ->will( $this->returnArgument( 0 ) ); - StoreFactory::setDefaultStoreForUnitTest( $store ); + $this->testEnvironment->registerObject( 'Store', $store ); + + $this->semanticDataValidator = $this->testEnvironment->getUtilityFactory()->newValidatorFactory()->newSemanticDataValidator(); + $this->dataValueFactory = DataValueFactory::getInstance(); } protected function tearDown() { - StoreFactory::clear(); + $this->testEnvironment->tearDown(); } public function testConstructor() { - $instance = new SemanticData( DIWikiPage::newFromTitle( Title::newFromText( __METHOD__ ) ) ); + $instance = new SemanticData( DIWikiPage::newFromText( __METHOD__ ) ); $this->assertInstanceOf( '\SMW\SemanticData', @@ -65,7 +67,7 @@ public function testConstructor() { public function testGetPropertyValues() { - $instance = new SemanticData( DIWikiPage::newFromTitle( Title::newFromText( __METHOD__ ) ) ); + $instance = new SemanticData( DIWikiPage::newFromText( __METHOD__ ) ); $this->assertInstanceOf( 'SMW\DIWikiPage', @@ -83,7 +85,7 @@ public function testGetPropertyValues() { public function testAddPropertyValue() { - $instance = new SemanticData( DIWikiPage::newFromTitle( Title::newFromText( __METHOD__ ) ) ); + $instance = new SemanticData( DIWikiPage::newFromText( __METHOD__ ) ); $instance->addPropertyValue( 'addPropertyValue', @@ -106,14 +108,13 @@ public function testAddPropertyValue() { public function testGetHash() { - $title = Title::newFromText( __METHOD__ ); - $instance = new SemanticData( DIWikiPage::newFromTitle( $title ) ); + $instance = new SemanticData( DIWikiPage::newFromText( __METHOD__ ) ); $instance->addDataValue( DataValueFactory::getInstance()->newPropertyObjectValueByText( 'Has fooQuex', 'Bar' ) ); - $subobject = $this->newSubobject( $title ); + $subobject = $this->newSubobject( $instance->getSubject()->getTitle() ); $instance->addPropertyObjectValue( $subobject->getProperty(), diff --git a/tests/phpunit/includes/storage/StoreFactoryTest.php b/tests/phpunit/includes/storage/StoreFactoryTest.php index c33f80bcf9..ca5dc435c6 100644 --- a/tests/phpunit/includes/storage/StoreFactoryTest.php +++ b/tests/phpunit/includes/storage/StoreFactoryTest.php @@ -58,20 +58,6 @@ public function testDifferentStoreIdInstanceInvocation() { ); } - public function testSetDefaultStoreForUnitTest() { - - $store = $this->getMockBuilder( '\SMWSQLStore3' ) - ->disableOriginalConstructor() - ->getMock(); - - StoreFactory::setDefaultStoreForUnitTest( $store ); - - $this->assertSame( - $store, - StoreFactory::getStore() - ); - } - public function testStoreInstanceException() { $this->setExpectedException( '\SMW\InvalidStoreException' ); StoreFactory::getStore( '\SMW\StoreFactory' ); diff --git a/tests/phpunit/includes/storage/sqlstore/Sql3StubSemanticDataTest.php b/tests/phpunit/includes/storage/sqlstore/Sql3StubSemanticDataTest.php index e679e2b805..ebc837a4a0 100644 --- a/tests/phpunit/includes/storage/sqlstore/Sql3StubSemanticDataTest.php +++ b/tests/phpunit/includes/storage/sqlstore/Sql3StubSemanticDataTest.php @@ -9,6 +9,7 @@ use SMWDITime as DITime; use SMWSql3StubSemanticData as StubSemanticData; use Title; +use SMW\Tests\TestEnvironment; /** * @covers \SMWSql3StubSemanticData @@ -24,12 +25,25 @@ class Sql3StubSemanticDataTest extends \PHPUnit_Framework_TestCase { private $store; + private $testEnvironment; protected function setUp() { - $this->store = $this->getMockBuilder( '\SMWSQLStore3' ) + $this->testEnvironment = new TestEnvironment(); + + $this->store = $this->getMockBuilder( '\SMW\SQLStore\SQLStore' ) ->disableOriginalConstructor() ->getMock(); + + $this->store->expects( $this->any() ) + ->method( 'getRedirectTarget' ) + ->will( $this->returnArgument( 0 ) ); + + $this->testEnvironment->registerObject( 'Store', $this->store ); + } + + protected function tearDown() { + $this->testEnvironment->tearDown(); } public function testCanConstruct() { @@ -110,16 +124,12 @@ public function testPhpSerialization( $property, $dataItem ) { $dataItem ); - StoreFactory::setDefaultStoreForUnitTest( $this->store ); - $serialization = serialize( $instance ); $this->assertEquals( $instance->getHash(), unserialize( $serialization )->getHash() ); - - StoreFactory::clear(); } /**