Debian Codegraph @

vendor/wikimedia/parsoid/tests/RTTestSettings.php

raw
1 <?php
2
3 // This file is loaded from wmf-config's CommonSettings.php
4
5 $wgReadOnly = "parsoidtest1001 access is read-only for Parsoid testing. " .
6 "You shouldn't need to write anything from here.";
7
8 // EVIL(ish) hack:
9 // Override autoloader to ensure all of Parsoid is running from the
10 // same place as this file (since there will also be another copy of
11 // Parsoid included from the vendor/wikimedia/parsoid directory)
12 AutoLoader::registerNamespaces( [
13 // Keep this in sync with the "autoload" clause in /composer.json!
14 'Wikimedia\\Parsoid\\' => __DIR__ . "/../src"
15 ] );
16
17 // When Parsoid is enabled in production context, this will
18 // have already been configured.
19 if ( !isset( $wgParsoidSettings ) ) {
20 // Temporarily enable all these defaults
21 $wgParsoidSettings = [];
22 }
23
24 // Override Parsoid-specific settings for rt-testing.
25 $wgParsoidSettings['useSelser'] = true;
26
27 // Linting during rt testing is useful to catch errors and crashers,
28 // but we don't want to save lints to the production db.
29 $wgParsoidSettings['linting'] = (bool)$wgReadOnly;
30
31 $wgParsoidSettings['metricsPrefix'] = 'Parsoid-Tests.';