registration: Ignore attributes that start with @
[lhc/web/wiklou.git] / tests / phpunit / includes / registration / ExtensionProcessorTest.php
index 221c258..e57c2b3 100644 (file)
@@ -18,6 +18,23 @@ class ExtensionProcessorTest extends MediaWikiTestCase {
                'name' => 'FooBar',
        );
 
+       /**
+        * @covers ExtensionProcessor::extractInfo
+        */
+       public function testExtractInfo() {
+               // Test that attributes that begin with @ are ignored
+               $processor = new ExtensionProcessor();
+               $processor->extractInfo( $this->dir, self::$default + array(
+                       '@metadata' => array( 'foobarbaz' ),
+                       'AnAttribute' => array( 'omg' ),
+               ) );
+
+               $extracted = $processor->getExtractedInfo();
+               $attributes = $extracted['attributes'];
+               $this->assertArrayHasKey( 'AnAttribute', $attributes );
+               $this->assertArrayNotHasKey( '@metadata', $attributes );
+       }
+
        public static function provideRegisterHooks() {
                return array(
                        // No hooks