aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/context/RequestContextTest.php
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2022-07-06 00:21:30 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2022-07-06 00:44:00 +0200
commit047c184bfef78cfc2217fe646dbfd24b866b8d00 (patch)
treea93e1e5e943184a2b177302f23d7a95a8fc9a915 /tests/phpunit/includes/context/RequestContextTest.php
parentfa69b9ad8788a86c6c4da5ad8e12865ab013b54a (diff)
downloadmediawikicore-047c184bfef78cfc2217fe646dbfd24b866b8d00.tar.gz
mediawikicore-047c184bfef78cfc2217fe646dbfd24b866b8d00.zip
tests: Use Title::makeTitle instead of Title::newFromText
Avoid parsing known titles in tests to improve performance Change-Id: Ibfccfe696f0b8bfda0b99abae324e60bbecef7d8
Diffstat (limited to 'tests/phpunit/includes/context/RequestContextTest.php')
-rw-r--r--tests/phpunit/includes/context/RequestContextTest.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/phpunit/includes/context/RequestContextTest.php b/tests/phpunit/includes/context/RequestContextTest.php
index a08f683443ae..97aededa5e6b 100644
--- a/tests/phpunit/includes/context/RequestContextTest.php
+++ b/tests/phpunit/includes/context/RequestContextTest.php
@@ -19,17 +19,17 @@ class RequestContextTest extends MediaWikiIntegrationTestCase {
public function testWikiPageTitle() {
$context = new RequestContext();
- $curTitle = Title::newFromText( "A" );
+ $curTitle = Title::makeTitle( NS_MAIN, "A" );
$context->setTitle( $curTitle );
$this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ),
"When a title is first set WikiPage should be created on-demand for that title." );
- $curTitle = Title::newFromText( "B" );
+ $curTitle = Title::makeTitle( NS_MAIN, "B" );
$context->setWikiPage( WikiPage::factory( $curTitle ) );
$this->assertTrue( $curTitle->equals( $context->getTitle() ),
"Title must be updated when a new WikiPage is provided." );
- $curTitle = Title::newFromText( "C" );
+ $curTitle = Title::makeTitle( NS_MAIN, "C" );
$context->setTitle( $curTitle );
$this->assertTrue(
$curTitle->equals( $context->getWikiPage()->getTitle() ),