X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FRevisionStorageTest.php;h=642ada20f2d9314d304c72cbea441efd7abd9ded;hb=ea23bc97ee9144c4575fa0bab81a42faa2b1f29c;hp=38661907a5415d5106497ac7b2bcee2d6af0da4d;hpb=9a6ff0bd82faafbf9746a6fa3ed33f42092587c3;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/RevisionStorageTest.php b/tests/phpunit/includes/RevisionStorageTest.php index 38661907a5..642ada20f2 100644 --- a/tests/phpunit/includes/RevisionStorageTest.php +++ b/tests/phpunit/includes/RevisionStorageTest.php @@ -274,18 +274,6 @@ class RevisionStorageTest extends MediaWikiTestCase { $this->assertEquals( $page->getId(), $rev->getPage() ); } - /** - * @covers Revision::getText - */ - public function testGetText() { - $this->hideDeprecated( 'Revision::getText' ); - - $orig = $this->makeRevision( [ 'text' => 'hello hello.' ] ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello.', $rev->getText() ); - } - /** * @covers Revision::getContent */ @@ -317,42 +305,7 @@ class RevisionStorageTest extends MediaWikiTestCase { /** * @covers Revision::getContentModel */ - public function testGetContentModel_default_model() { - global $wgContentHandlerUseDB; - - if ( !$wgContentHandlerUseDB ) { - $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' ); - } - - $orig = $this->makeRevision( [ 'text' => 'hello hello.', ] ); - - // Change namespace default content model, to make sure getContentModel() uses the - // page content model, not the namespace default. - $ns = $this->getDefaultWikitextNS(); - $this->mergeMwGlobalArrayValue( 'wgNamespaceContentModels', [ $ns => CONTENT_MODEL_JSON ] ); - - $rev = Revision::newFromId( $orig->getId() ); - - // we should still get the correct content model from the page table - $this->assertEquals( CONTENT_MODEL_WIKITEXT, $rev->getContentModel() ); - - // check that we don't null the revision model if it's equal to the default, but not to - // the current page model. - $second = $this->makeRevision( [ - 'text' => '{ "say":"hello" }', - 'content_model' => CONTENT_MODEL_JAVASCRIPT - ] ); - - $rev = Revision::newFromId( $second->getId() ); - - // we should now get the content model from the revision table - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() ); - } - - /** - * @covers Revision::getContentModel - */ - public function testGetContentModel_other_model() { + public function testGetContentModel() { global $wgContentHandlerUseDB; if ( !$wgContentHandlerUseDB ) { @@ -360,7 +313,7 @@ class RevisionStorageTest extends MediaWikiTestCase { } $orig = $this->makeRevision( [ 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT ] ); + 'content_model' => CONTENT_MODEL_JAVASCRIPT ] ); $rev = Revision::newFromId( $orig->getId() ); $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() );