$value ) { if ( in_array( $key, self::ALT_HTML_KEYS, true ) ) { $this->altHtmlSections[$key] = $value; } elseif ( in_array( $key, self::ALT_WT_KEYS, true ) ) { $this->altWtSections[$key] = $value; } else { $this->$key = $value; } } if ( isset( $this->options['parsoid'] ) ) { $this->options['parsoid'] = PHPUtils::jsonDecode( PHPUtils::jsonEncode( $this->options['parsoid'] ) ); } } /** * @param array $testFilter Test Filter as set in TestRunner * @return bool if test matches the filter */ public function matchesFilter( $testFilter ): bool { if ( !$testFilter ) { return true; // Trivial match } if ( !empty( $testFilter['regex'] ) ) { return (bool)preg_match( '/' . $testFilter['raw'] . '/', $this->title ); } if ( !empty( $testFilter['string'] ) ) { return strpos( $this->title, $testFilter['raw'] ) !== false; } return true; // Trivial match because of a bad test filter } /** * @return string */ public function pageName(): string { if ( !$this->pageName ) { $this->pageName = $this->options['title'] ?? 'Parser test'; if ( is_array( $this->pageName ) ) { $this->pageName = 'Parser test'; } } return $this->pageName; } }