Merge "Introduce constants for fetchLanguageName(s)"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiParseTest.php
index a04271f..7f2c1a6 100644 (file)
@@ -77,11 +77,15 @@ class ApiParseTest extends ApiTestCase {
                        $expectedEnd = "</div>";
                        $this->assertSame( $expectedEnd, substr( $html, -strlen( $expectedEnd ) ) );
 
+                       $unexpectedEnd = '#<!-- \nNewPP limit report|' .
+                               '<!--\nTransclusion expansion time report#s';
+                       $this->assertNotRegExp( $unexpectedEnd, $html );
+
                        $html = substr( $html, 0, strlen( $html ) - strlen( $expectedEnd ) );
                } else {
                        $expectedEnd = '#\n<!-- \nNewPP limit report\n(?>.+?\n-->)\n' .
                                '<!--\nTransclusion expansion time report \(%,ms,calls,template\)\n(?>.*?\n-->)\n' .
-                               '</div>(\n<!-- Saved in parser cache (?>.*?\n -->)\n)?$#s';
+                               '(\n<!-- Saved in parser cache (?>.*?\n -->)\n)?</div>$#s';
                        $this->assertRegExp( $expectedEnd, $html );
 
                        $html = preg_replace( $expectedEnd, '', $html );
@@ -133,6 +137,7 @@ class ApiParseTest extends ApiTestCase {
                                ->getMock();
                        $skin->expects( $this->once() )->method( 'getDefaultModules' )
                                ->willReturn( [
+                                       'styles' => [ 'core' => [ 'quux.styles' ] ],
                                        'core' => [ 'foo', 'bar' ],
                                        'content' => [ 'baz' ]
                                ] );
@@ -686,7 +691,7 @@ class ApiParseTest extends ApiTestCase {
                        'resp.parse.modulescripts'
                );
                $this->assertSame(
-                       [ 'foo.styles' ],
+                       [ 'foo.styles', 'quux.styles' ],
                        $res[0]['parse']['modulestyles'],
                        'resp.parse.modulestyles'
                );