aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/TrackingCategoriesTest.php
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2023-09-12 20:28:21 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2023-09-13 00:09:05 +0200
commit790ae736c165bc6b2e2cc893c1b0be2cbd2628b3 (patch)
treeb420e7567fe0e701fabef992d16b6bc370b3f4e5 /tests/phpunit/includes/TrackingCategoriesTest.php
parent707450bc74891a125f8826b0a7c004ea3c79c48c (diff)
downloadmediawikicore-790ae736c165bc6b2e2cc893c1b0be2cbd2628b3.tar.gz
mediawikicore-790ae736c165bc6b2e2cc893c1b0be2cbd2628b3.zip
tests: Move test cases from /includes/ into sub folder
Follow move of the tested class Most moves are part of T321882 Change-Id: I74ab45d6a5331dcb2ff0b65dc2cc7c6315146646
Diffstat (limited to 'tests/phpunit/includes/TrackingCategoriesTest.php')
-rw-r--r--tests/phpunit/includes/TrackingCategoriesTest.php48
1 files changed, 0 insertions, 48 deletions
diff --git a/tests/phpunit/includes/TrackingCategoriesTest.php b/tests/phpunit/includes/TrackingCategoriesTest.php
deleted file mode 100644
index e5dbb9068b35..000000000000
--- a/tests/phpunit/includes/TrackingCategoriesTest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-
-use MediaWiki\Category\TrackingCategories;
-use MediaWiki\Config\ServiceOptions;
-use MediaWiki\Logger\LoggerFactory;
-use MediaWiki\Page\PageReferenceValue;
-
-/**
- * @covers ParserOutput
- * @covers CacheTime
- * @group Database
- * ^--- trigger DB shadowing because we are using Title magic
- */
-class TrackingCategoriesTest extends MediaWikiLangTestCase {
- /**
- * @covers ParserOutput::addTrackingCategory
- */
- public function testAddTrackingCategory() {
- $services = $this->getServiceContainer();
- $tc = new TrackingCategories(
- new ServiceOptions(
- TrackingCategories::CONSTRUCTOR_OPTIONS,
- $services->getMainConfig()
- ),
- $services->getNamespaceInfo(),
- $services->getTitleParser(),
- LoggerFactory::getInstance( 'TrackingCategories' )
- );
-
- $po = new ParserOutput;
- $po->setPageProperty( 'defaultsort', 'foobar' );
-
- $page = PageReferenceValue::localReference( NS_USER, 'Testing' );
-
- $tc->addTrackingCategory( $po, 'index-category', $page ); // from CORE_TRACKING_CATEGORIES
- $tc->addTrackingCategory( $po, 'sitenotice', $page ); // should be "-", which is ignored
- $tc->addTrackingCategory( $po, 'brackets-start', $page ); // invalid text
- // TODO: assert proper handling of non-existing messages
-
- $expected = wfMessage( 'index-category' )
- ->page( $page )
- ->inContentLanguage()
- ->text();
-
- $expected = strtr( $expected, ' ', '_' );
- $this->assertSame( [ $expected => 'foobar' ], $po->getCategories() );
- }
-}