X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FEditPageTest.php;h=8f0826b5e6840773372ce70f56a7c02410dc2843;hb=953cf998e3ef64972970b287bb8ec899191508e1;hp=9507811ec2c925bedd8fb318ef4b9e8f73279105;hpb=49748181dd56ec97e7ba7c13e684a16abceb3cc0;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/EditPageTest.php b/tests/phpunit/includes/EditPageTest.php index 9507811ec2..8f0826b5e6 100644 --- a/tests/phpunit/includes/EditPageTest.php +++ b/tests/phpunit/includes/EditPageTest.php @@ -29,10 +29,18 @@ class EditPageTest extends MediaWikiLangTestCase { $wgNamespaceContentModels[12312] = "testing"; $wgContentHandlers["testing"] = 'DummyContentHandlerForTesting'; - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache + MWNamespace::clearCaches(); $wgContLang->resetNamespaces(); # reset namespace cache } + protected function tearDown() { + global $wgContLang; + + MWNamespace::clearCaches(); + $wgContLang->resetNamespaces(); # reset namespace cache + parent::tearDown(); + } + /** * @dataProvider provideExtractSectionTitle * @covers EditPage::extractSectionTitle @@ -165,6 +173,10 @@ class EditPageTest extends MediaWikiLangTestCase { $edit['wpStarttime'] = wfTimestampNow(); } + if ( !isset( $edit['wpUnicodeCheck'] ) ) { + $edit['wpUnicodeCheck'] = EditPage::UNICODE_CHECK; + } + $req = new FauxRequest( $edit, true ); // session ?? $article = new Article( $title ); @@ -697,14 +709,15 @@ hello 'wpTextbox1' => serialize( 'non-text content' ), 'wpEditToken' => $user->getEditToken(), 'wpEdittime' => '', - 'wpStarttime' => wfTimestampNow() + 'wpStarttime' => wfTimestampNow(), + 'wpUnicodeCheck' => EditPage::UNICODE_CHECK, ]; $req = new FauxRequest( $edit, true ); $ep->importFormData( $req ); $this->setExpectedException( - 'MWException', + MWException::class, 'This content model is not supported: testing' );