public function testCanonicalNames()
 {
     $this->mwHooksHandler->deregisterListedHooks();
     $count = 0;
     $index = NamespaceManager::buildNamespaceIndex(Settings::newFromGlobals()->get('smwgNamespaceIndex'));
     $names = NamespaceManager::getCanonicalNames();
     $this->assertInternalType('array', $names);
     $this->assertInternalType('array', $index);
     foreach ($index as $ns => $idx) {
         $mwNamespace = MWNamespace::getCanonicalName($idx);
         if ($mwNamespace && isset($names[$idx])) {
             $this->assertEquals($mwNamespace, $names[$idx]);
             $count++;
         }
     }
     $this->assertCount($count, $names, "Asserts that expected amount of cannonical names have been verified");
 }
コード例 #2
0
 public function testBuildNamespaceIndex()
 {
     $this->assertInternalType('array', NamespaceManager::buildNamespaceIndex(100));
 }