コード例 #1
0
 /**
  * @see ByJsonTestCaseProvider::runTestCaseFile
  *
  * @param JsonTestCaseFileHandler $jsonTestCaseFileHandler
  */
 protected function runTestCaseFile(JsonTestCaseFileHandler $jsonTestCaseFileHandler)
 {
     $this->checkEnvironmentToSkipCurrentTest($jsonTestCaseFileHandler);
     $permittedSettings = array('smwgNamespace', 'wgContLang', 'wgLang', 'smwgQMaxSize', 'smwStrictComparators', 'smwgNamespacesWithSemanticLinks');
     foreach ($permittedSettings as $key) {
         $this->changeGlobalSettingTo($key, $jsonTestCaseFileHandler->getSettingsFor($key));
     }
     $this->createPagesFor($jsonTestCaseFileHandler->getListOfProperties(), SMW_NS_PROPERTY);
     $this->createPagesFor($jsonTestCaseFileHandler->getListOfSubjects(), NS_MAIN);
     $this->queryTestCaseProcessor->setDebugMode($jsonTestCaseFileHandler->getDebugMode());
     foreach ($jsonTestCaseFileHandler->findTestCasesFor('query-testcases') as $queryCase) {
         $this->queryTestCaseProcessor->processQueryCase(new QueryTestCaseInterpreter($queryCase));
     }
     foreach ($jsonTestCaseFileHandler->findTestCasesFor('concept-testcases') as $conceptCase) {
         $this->queryTestCaseProcessor->processConceptCase(new QueryTestCaseInterpreter($conceptCase));
     }
     foreach ($jsonTestCaseFileHandler->findTestCasesFor('format-testcases') as $formatCase) {
         $this->queryTestCaseProcessor->processFormatCase(new QueryTestCaseInterpreter($formatCase));
     }
 }
コード例 #2
0
 /**
  * @see ByJsonTestCaseProvider::runTestCaseFile
  *
  * @param JsonTestCaseFileHandler $jsonTestCaseFileHandler
  */
 protected function runTestCaseFile(JsonTestCaseFileHandler $jsonTestCaseFileHandler)
 {
     $this->checkEnvironmentToSkipCurrentTest($jsonTestCaseFileHandler);
     $permittedSettings = array('smwgNamespace', 'wgContLang', 'wgLang', 'smwgQMaxSize', 'smwStrictComparators', 'smwgNamespacesWithSemanticLinks', 'smwgQSubpropertyDepth', 'smwgQSubcategoryDepth', 'smwgQConceptCaching');
     foreach ($permittedSettings as $key) {
         $this->changeGlobalSettingTo($key, $jsonTestCaseFileHandler->getSettingsFor($key));
     }
     // Set query parser late to ensure that expected settings are adjusted
     // (language etc.) because the __construct relies on the context language
     $this->queryTestCaseProcessor->setQueryParser(ApplicationFactory::getInstance()->newQueryParser());
     $this->createPagesFor($jsonTestCaseFileHandler->getListOfProperties(), SMW_NS_PROPERTY);
     $this->createPagesFor($jsonTestCaseFileHandler->getListOfSubjects(), NS_MAIN);
     $this->queryTestCaseProcessor->setDebugMode($jsonTestCaseFileHandler->getDebugMode());
     foreach ($jsonTestCaseFileHandler->findTestCasesFor('query-testcases') as $queryCase) {
         $this->queryTestCaseProcessor->processQueryCase(new QueryTestCaseInterpreter($queryCase));
     }
     foreach ($jsonTestCaseFileHandler->findTestCasesFor('concept-testcases') as $conceptCase) {
         $this->queryTestCaseProcessor->processConceptCase(new QueryTestCaseInterpreter($conceptCase));
     }
     foreach ($jsonTestCaseFileHandler->findTestCasesFor('format-testcases') as $formatCase) {
         $this->queryTestCaseProcessor->processFormatCase(new QueryTestCaseInterpreter($formatCase));
     }
 }