foreach ( $info as $key => $val ) {
if ( in_array( $key, self::$globalSettings ) ) {
$this->storeToArray( "wg$key", $val, $this->globals );
- } elseif ( !in_array( $key, $this->processed ) ) {
+ // Ignore anything that starts with a @
+ } elseif ( $key[0] !== '@' && !in_array( $key, $this->processed ) ) {
$this->storeToArray( $key, $val, $this->attributes );
}
}
'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