Debian Codegraph @

tests/phpunit/includes/content/JavaScriptContentHandlerIntegrationTest.php

raw symbols SCIP
1 <?php
2
3 /**
4 * @group ContentHandler
5 * @group Database
6 * ^--- needed, because we do need the database to test link updates
7 * @covers \MediaWiki\Content\JavaScriptContentHandler
8 */
9 class JavaScriptContentHandlerIntegrationTest extends TextContentHandlerIntegrationTest {
10 public static function provideGetParserOutput() {
11 yield 'Basic render' => [
12 'title' => 'MediaWiki:Test.js',
13 'model' => null,
14 'text' => "hello <world>\n",
15 'expectedHtml' => "<pre class=\"mw-code mw-js\" dir=\"ltr\">hello &lt;world&gt;\n\n</pre>",
16 'expectedFields' => [
17 'Links' => [
18 ],
19 'Sections' => [
20 ],
21 ],
22 ];
23 yield 'Links' => [
24 'title' => 'MediaWiki:Test.js',
25 'model' => null,
26 'text' => "hello(); // [[world]]\n",
27 'expectedHtml' => "<pre class=\"mw-code mw-js\" dir=\"ltr\">hello(); // [[world]]\n\n</pre>",
28 'expectedFields' => [
29 'Links' => [
30 [ 'World' => 0, ],
31 ],
32 'Sections' => [
33 ],
34 ],
35 ];
36 yield 'TOC' => [
37 'title' => 'MediaWiki:Test.js',
38 'model' => null,
39 'text' => "==One==\n<h2>Two</h2>",
40 'expectedHtml' => "<pre class=\"mw-code mw-js\" dir=\"ltr\">==One==\n&lt;h2&gt;Two&lt;/h2&gt;\n</pre>",
41 'expectedFields' => [
42 'Links' => [
43 ],
44 # T307691
45 'Sections' => [
46 ],
47 ],
48 ];
49 }
50 }