protected function setUp()
 {
     parent::setUp();
     $this->messageReporterFactory = MessageReporterFactory::getInstance();
     $this->tableBuilder = TableBuilder::factory($this->getStore()->getConnection(DB_MASTER));
     $this->stringValidator = $this->testEnvironment->getUtilityFactory()->newValidatorFactory()->newStringValidator();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->testEnvironment->addConfiguration('smwgEnabledDeferredUpdate', false);
     $this->pageCreator = UtilityFactory::getInstance()->newPageCreator();
     $this->semanticDataValidator = UtilityFactory::getInstance()->newValidatorFactory()->newSemanticDataValidator();
 }
 protected function setUp()
 {
     parent::setUp();
     // Variable set using phpunit.xml
     if (isset($GLOBALS['benchmarkQueryRepetitionExecutionThreshold'])) {
         $this->repetitionExecutionThreshold = $GLOBALS['benchmarkQueryRepetitionExecutionThreshold'];
     }
     if (isset($GLOBALS['benchmarkPageCopyThreshold'])) {
         $this->pageCopyThreshold = $GLOBALS['benchmarkPageCopyThreshold'];
     }
     if (isset($GLOBALS['benchmarkShowMemoryUsage'])) {
         $this->showMemoryUsage = (bool) $GLOBALS['benchmarkShowMemoryUsage'];
     }
     if (isset($GLOBALS['benchmarkQueryLimit'])) {
         $this->queryLimit = $GLOBALS['benchmarkQueryLimit'];
     }
     if (isset($GLOBALS['benchmarkQueryOffset'])) {
         $this->queryOffset = $GLOBALS['benchmarkQueryOffset'];
     }
     if (isset($GLOBALS['benchmarkReuseDatasets'])) {
         $this->reuseDatasets = $GLOBALS['benchmarkReuseDatasets'];
     }
     $this->queryParser = new QueryParser();
     $this->benchmarkRunner = new BenchmarkRunner();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->semanticDataFactory = UtilityFactory::getInstance()->newSemanticDataFactory();
     $this->mwHooksHandler = UtilityFactory::getInstance()->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks();
 }
 protected function setUp()
 {
     parent::setUp();
     $utilityFactory = UtilityFactory::getInstance();
     $this->fixturesFileProvider = $utilityFactory->newFixturesFactory()->newFixturesFileProvider();
     $this->semanticDataValidator = $utilityFactory->newValidatorFactory()->newSemanticDataValidator();
     $this->pageEditor = $utilityFactory->newPageEditor();
     $this->mwHooksHandler = $utilityFactory->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $settings = array('smwgPageSpecialProperties' => array('_MEDIA', '_MIME'), 'smwgNamespacesWithSemanticLinks' => array(NS_MAIN => true, NS_FILE => true), 'smwgCacheType' => 'hash');
     foreach ($settings as $key => $value) {
         $this->applicationFactory->getSettings()->set($key, $value);
     }
     //	$this->getStore()->clear();
     //	$this->getStore()->setupStore( false );
     $this->wgEnableUploads = $GLOBALS['wgEnableUploads'];
     $this->wgFileExtensions = $GLOBALS['wgFileExtensions'];
     $this->wgVerifyMimeType = $GLOBALS['wgVerifyMimeType'];
     $this->mwHooksHandler->register('FileUpload', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('FileUpload'));
     $this->mwHooksHandler->register('InternalParseBeforeLinks', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('InternalParseBeforeLinks'));
     $this->mwHooksHandler->register('LinksUpdateConstructed', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('LinksUpdateConstructed'));
     $GLOBALS['wgEnableUploads'] = true;
     $GLOBALS['wgFileExtensions'] = array('txt');
     $GLOBALS['wgVerifyMimeType'] = true;
 }
 protected function setUp()
 {
     parent::setUp();
     $this->dataValueFactory = DataValueFactory::getInstance();
     $this->queryResultValidator = UtilityFactory::getInstance()->newValidatorFactory()->newQueryResultValidator();
     $this->semanticDataFactory = UtilityFactory::getInstance()->newSemanticDataFactory();
 }
 protected function setUp()
 {
     parent::setUp();
     $utilityFactory = UtilityFactory::getInstance();
     $this->fileReader = $utilityFactory->newJsonFileReader(null);
     $this->pageCreator = $utilityFactory->newPageCreator();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->mwHooksHandler = new MwHooksHandler();
     $this->pageDeleter = new PageDeleter();
     $this->pageCreator = new PageCreator();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->semanticDataFactory = UtilityFactory::getInstance()->newSemanticDataFactory();
     $this->queryResultValidator = UtilityFactory::getInstance()->newValidatorFactory()->newQueryResultValidator();
     $this->fixturesProvider = UtilityFactory::getInstance()->newFixturesFactory()->newFixturesProvider();
     $this->fixturesProvider->setupDependencies($this->getStore());
 }
 protected function setUp()
 {
     parent::setUp();
     $utilityFactory = UtilityFactory::getInstance();
     $this->pageCreator = $utilityFactory->newPageCreator();
     $this->stringBuilder = $utilityFactory->newStringBuilder();
     $this->stringValidator = $utilityFactory->newValidatorFactory()->newStringValidator();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->queryResultValidator = UtilityFactory::getInstance()->newValidatorFactory()->newQueryResultValidator();
     $this->semanticDataFactory = UtilityFactory::getInstance()->newSemanticDataFactory();
     $this->queryParser = new QueryParser();
     //	$this->getStore()->getSparqlDatabase()->deleteAll();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->dataValueFactory = DataValueFactory::getInstance();
     $this->queryResultValidator = UtilityFactory::getInstance()->newValidatorFactory()->newQueryResultValidator();
     $this->semanticDataFactory = UtilityFactory::getInstance()->newSemanticDataFactory();
     $this->testEnvironment->addConfiguration('smwgQueryResultCacheType', false);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->apiFactory = new MwApiFactory();
     $this->dataValueFactory = DataValueFactory::getInstance();
     $this->serializerFactory = new SerializerFactory();
     $this->semanticDataFactory = new SemanticDataFactory();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->semanticDataFactory = UtilityFactory::getInstance()->newSemanticDataFactory();
     $this->fixturesProvider = UtilityFactory::getInstance()->newFixturesFactory()->newFixturesProvider();
     $this->fixturesProvider->setupDependencies($this->getStore());
     $this->getStore()->updateData($this->fixturesProvider->getFactsheet('Berlin')->asEntity());
     $this->getStore()->updateData($this->fixturesProvider->getFactsheet('Paris')->asEntity());
 }
 protected function setUp()
 {
     parent::setUp();
     // Variable set using phpunit.xml
     if (isset($GLOBALS['benchmarkShowMemoryUsage'])) {
         $this->showMemoryUsage = $GLOBALS['benchmarkShowMemoryUsage'];
     }
     $this->benchmarkRunner = new BenchmarkRunner($this->showMemoryUsage);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->mwHooksHandler = UtilityFactory::getInstance()->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks()->invokeHooksFromRegistry();
     $this->semanticDataValidator = UtilityFactory::getInstance()->newValidatorFactory()->newSemanticDataValidator();
     $this->pageCreator = UtilityFactory::getInstance()->newPageCreator();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $this->dataValueFactory = DataValueFactory::getInstance();
 }
 protected function setUp()
 {
     parent::setUp();
     $utilityFactory = UtilityFactory::getInstance();
     $utilityFactory->newMwHooksHandler()->deregisterListedHooks();
     $utilityFactory->newMwHooksHandler()->invokeHooksFromRegistry();
     $this->fileReader = $utilityFactory->newJsonFileReader(null);
     $this->pageCreator = $utilityFactory->newPageCreator();
     $this->pageDeleter = $utilityFactory->newPageDeleter();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->pageCreator = UtilityFactory::getInstance()->newpageCreator();
     $this->stringValidator = UtilityFactory::getInstance()->newValidatorFactory()->newStringValidator();
     // FIXME
     // ApplicationFactory::getInstance()->getSettings()->set( 'smwgNamespace', "http://example.org/id/" );
     $this->smwgNamespace = $GLOBALS['smwgNamespace'];
     $GLOBALS['smwgNamespace'] = "http://example.org/id/";
 }
 protected function setUp()
 {
     parent::setUp();
     $this->mwHooksHandler = UtilityFactory::getInstance()->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks()->invokeHooksFromRegistry();
     $this->semanticDataValidator = UtilityFactory::getInstance()->newValidatorFactory()->newSemanticDataValidator();
     $this->pageDeleter = new PageDeleter();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $this->applicationFactory->getSettings()->set('smwgPageSpecialProperties', array('_MDAT'));
 }
 protected function setUp()
 {
     parent::setUp();
     $this->testEnvironment->addConfiguration('smwgPageSpecialProperties', array('_MDAT'));
     $this->mwHooksHandler = $this->testEnvironment->getUtilityFactory()->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks();
     $this->mwHooksHandler->invokeHooksFromRegistry();
     $this->semanticDataValidator = $this->testEnvironment->getUtilityFactory()->newValidatorFactory()->newSemanticDataValidator();
     $this->pageDeleter = $this->testEnvironment->getUtilityFactory()->newPageDeleter();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->runnerFactory = UtilityFactory::getInstance()->newRunnerFactory();
     $this->titleValidator = UtilityFactory::getInstance()->newValidatorFactory()->newTitleValidator();
     $importRunner = $this->runnerFactory->newXmlImportRunner(__DIR__ . '/../Fixtures/' . 'GenericLoremIpsumTest-Mw-1-19-7.xml');
     if (!$importRunner->setVerbose(true)->run()) {
         $importRunner->reportFailedImport();
         $this->markTestIncomplete('Test was marked as incomplete because the data import failed');
     }
 }
 protected function setUp()
 {
     parent::setUp();
     $utilityFactory = UtilityFactory::getInstance();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $this->queryResultValidator = $utilityFactory->newValidatorFactory()->newQueryResultValidator();
     $this->mwHooksHandler = $utilityFactory->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks();
     $this->mwHooksHandler->register('TitleMoveComplete', $this->mwHooksHandler->getHookRegistry()->getDefinition('TitleMoveComplete'));
     $this->pageCreator = $utilityFactory->newPageCreator();
 }
 protected function setUp()
 {
     parent::setUp();
     $utilityFactory = $this->testEnvironment->getUtilityFactory();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $this->queryResultValidator = $utilityFactory->newValidatorFactory()->newQueryResultValidator();
     $this->mwHooksHandler = $utilityFactory->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks();
     $this->mwHooksHandler->register('TitleMoveComplete', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('TitleMoveComplete'));
     $this->pageCreator = $utilityFactory->newPageCreator();
     $this->testEnvironment->addConfiguration('smwgEnabledDeferredUpdate', false);
 }
예제 #24
0
 protected function setUp()
 {
     parent::setUp();
     $this->mwHooksHandler = $this->testEnvironment->getUtilityFactory()->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks();
     $this->mwHooksHandler->invokeHooksFromRegistry();
     $this->semanticDataValidator = $this->testEnvironment->getUtilityFactory()->newValidatorFactory()->newSemanticDataValidator();
     $this->pageCreator = $this->testEnvironment->getUtilityFactory()->newPageCreator();
     $this->pageDeleter = $this->testEnvironment->getUtilityFactory()->newPageDeleter();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $this->testEnvironment->addConfiguration('smwgPageSpecialProperties', array('_MDAT'));
     $this->title = Title::newFromText(__METHOD__);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->runnerFactory = $this->testEnvironment->getUtilityFactory()->newRunnerFactory();
     $this->titleValidator = $this->testEnvironment->getUtilityFactory()->newValidatorFactory()->newTitleValidator();
     // Remove any predisposed settings
     $this->testEnvironment->tearDown();
     $importRunner = $this->runnerFactory->newXmlImportRunner($this->testEnvironment->getFixturesLocation('Import', 'cicero-de-finibus.xml'));
     if (!$importRunner->setVerbose(true)->run()) {
         $importRunner->reportFailedImport();
         $this->markTestIncomplete('Test was marked as incomplete because the data import failed');
     }
 }
 protected function setUp()
 {
     parent::setUp();
     $this->mwHooksHandler = UtilityFactory::getInstance()->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks()->invokeHooksFromRegistry();
     $this->semanticDataValidator = UtilityFactory::getInstance()->newValidatorFactory()->newSemanticDataValidator();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $settings = array('smwgPageSpecialProperties' => array('_MDAT'), 'smwgNamespacesWithSemanticLinks' => array(NS_MAIN => true), 'smwgCacheType' => 'hash', 'smwgAutoRefreshOnPurge' => true, 'smwgDeleteSubjectAsDeferredJob' => false, 'smwgDeleteSubjectWithAssociatesRefresh' => false);
     foreach ($settings as $key => $value) {
         $this->applicationFactory->getSettings()->set($key, $value);
     }
     $this->pageDeleter = new PageDeleter();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->runnerFactory = UtilityFactory::getInstance()->newRunnerFactory();
     $this->titleValidator = UtilityFactory::getInstance()->newValidatorFactory()->newTitleValidator();
     $this->semanticDataValidator = UtilityFactory::getInstance()->newValidatorFactory()->newSemanticDataValidator();
     $this->pageRefresher = UtilityFactory::getInstance()->newPageRefresher();
     $this->pageCreator = UtilityFactory::getInstance()->newPageCreator();
     $importRunner = $this->runnerFactory->newXmlImportRunner(__DIR__ . '/' . 'Fixtures/' . 'RedirectPageTest-Mw-1-19-7.xml');
     if (!$importRunner->setVerbose(true)->run()) {
         $importRunner->reportFailedImport();
         $this->markTestIncomplete('Test was marked as incomplete because the data import failed');
     }
 }
 protected function setUp()
 {
     parent::setUp();
     $utilityFactory = $this->testEnvironment->getUtilityFactory();
     $this->fixturesFileProvider = $utilityFactory->newFixturesFactory()->newFixturesFileProvider();
     $this->stringValidator = $utilityFactory->newValidatorFactory()->newStringValidator();
     $this->testEnvironment->withConfiguration(array('smwgPageSpecialProperties' => array('_MEDIA', '_MIME'), 'smwgNamespacesWithSemanticLinks' => array(NS_MAIN => true, NS_FILE => true), 'smwgCacheType' => 'hash', 'smwgExportBCAuxiliaryUse' => true));
     // Ensure that the DB creates the extra tables for MEDIA/MINE
     $this->getStore()->clear();
     $this->getStore()->setupStore(false);
     // MW GLOBALS to be restored after the test
     $this->testEnvironment->withConfiguration(array('wgEnableUploads' => true, 'wgFileExtensions' => array('txt'), 'wgVerifyMimeType' => true));
     \SMWExporter::clear();
 }
 protected function setUp()
 {
     parent::setUp();
     $utilityFactory = $this->testEnvironment->getUtilityFactory();
     $utilityFactory->newMwHooksHandler()->deregisterListedHooks();
     $utilityFactory->newMwHooksHandler()->invokeHooksFromRegistry();
     $this->fileReader = $utilityFactory->newJsonFileReader(null);
     $this->pageCreator = $utilityFactory->newPageCreator();
     $this->pageDeleter = $utilityFactory->newPageDeleter();
     if ($this->getStore() instanceof \SMWSparqlStore) {
         $this->connectorId = strtolower($GLOBALS['smwgSparqlDatabaseConnector']);
     } else {
         $this->connectorId = strtolower($this->getDBConnection()->getType());
     }
 }
 protected function setUp()
 {
     parent::setUp();
     $utilityFactory = $this->testEnvironment->getUtilityFactory();
     $this->fixturesFileProvider = $utilityFactory->newFixturesFactory()->newFixturesFileProvider();
     $this->semanticDataValidator = $utilityFactory->newValidatorFactory()->newSemanticDataValidator();
     $this->pageEditor = $utilityFactory->newPageEditor();
     $this->mwHooksHandler = $utilityFactory->newMwHooksHandler();
     $this->mwHooksHandler->deregisterListedHooks();
     $this->testEnvironment->withConfiguration(array('smwgPageSpecialProperties' => array('_MEDIA', '_MIME'), 'smwgNamespacesWithSemanticLinks' => array(NS_MAIN => true, NS_FILE => true), 'smwgCacheType' => 'hash'));
     $this->testEnvironment->withConfiguration(array('wgEnableUploads' => true, 'wgFileExtensions' => array('txt'), 'wgVerifyMimeType' => true));
     $this->mwHooksHandler->register('FileUpload', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('FileUpload'));
     $this->mwHooksHandler->register('InternalParseBeforeLinks', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('InternalParseBeforeLinks'));
     $this->mwHooksHandler->register('LinksUpdateConstructed', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('LinksUpdateConstructed'));
 }