diff options
author | Legoktm <legoktm@member.fsf.org> | 2019-06-13 23:00:08 +0000 |
---|---|---|
committer | Legoktm <legoktm@member.fsf.org> | 2019-06-13 23:00:08 +0000 |
commit | 4e35134f7a3228a8195a07f49c85188e57ab8487 (patch) | |
tree | d9750a18496af4c52eb5dfce56f0d0b79fbd32cb /tests | |
parent | 0a2b996278e57a8b8c5377cd3a3eaa54f993d4a9 (diff) | |
download | mediawikicore-4e35134f7a3228a8195a07f49c85188e57ab8487.tar.gz mediawikicore-4e35134f7a3228a8195a07f49c85188e57ab8487.zip |
Revert "Separate MediaWiki unit and integration tests"
This reverts commit 0a2b996278e57a8b8c5377cd3a3eaa54f993d4a9.
Reason for revert: Broke postgres tests.
Change-Id: I27d8e0c807ad5f0748b9611a4f3df84cc213fbe1
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common/TestSetup.php | 3 | ||||
-rw-r--r-- | tests/common/TestsAutoLoader.php | 3 | ||||
-rw-r--r-- | tests/phpunit/MediaWikiUnitTestCase.php | 36 | ||||
-rw-r--r-- | tests/phpunit/documentation/ReleaseNotesTest.php (renamed from tests/phpunit/unit/documentation/ReleaseNotesTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/CommentStoreCommentTest.php (renamed from tests/phpunit/unit/includes/CommentStoreCommentTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/DerivativeRequestTest.php (renamed from tests/phpunit/unit/includes/DerivativeRequestTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/FauxRequestTest.php (renamed from tests/phpunit/unit/includes/FauxRequestTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/FauxResponseTest.php (renamed from tests/phpunit/unit/includes/FauxResponseTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/FormOptionsInitializationTest.php (renamed from tests/phpunit/unit/includes/FormOptionsInitializationTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/FormOptionsTest.php (renamed from tests/phpunit/unit/includes/FormOptionsTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfAppendQueryTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfAppendQueryTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfArrayPlus2dTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfArrayPlus2dTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfAssembleUrlTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfBaseNameTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfEscapeShellArgTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfEscapeShellArgTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfGetCallerTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfShellExecTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfShellExecTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfShorthandToIntegerTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfStringToBoolTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfStringToBoolTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfTimestampTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php (renamed from tests/phpunit/unit/includes/GlobalFunctions/wfUrlencodeTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/HooksTest.php (renamed from tests/phpunit/unit/includes/HooksTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/LicensesTest.php (renamed from tests/phpunit/unit/includes/LicensesTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/ListToggleTest.php (renamed from tests/phpunit/unit/includes/ListToggleTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/MagicWordFactoryTest.php (renamed from tests/phpunit/unit/includes/MagicWordFactoryTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/MediaWikiServicesTest.php (renamed from tests/phpunit/unit/includes/MediaWikiServicesTest.php) | 14 | ||||
-rw-r--r-- | tests/phpunit/includes/MediaWikiVersionFetcherTest.php (renamed from tests/phpunit/unit/includes/MediaWikiVersionFetcherTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/PathRouterTest.php (renamed from tests/phpunit/unit/includes/PathRouterTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/Revision/FallbackSlotRoleHandlerTest.php (renamed from tests/phpunit/unit/includes/Revision/FallbackSlotRoleHandlerTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/Revision/MainSlotRoleHandlerTest.php (renamed from tests/phpunit/unit/includes/Revision/MainSlotRoleHandlerTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/Revision/RevisionStoreFactoryTest.php (renamed from tests/phpunit/unit/includes/Revision/RevisionStoreFactoryTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/Revision/SlotRecordTest.php (renamed from tests/phpunit/unit/includes/Revision/SlotRecordTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/Revision/SlotRoleHandlerTest.php (renamed from tests/phpunit/unit/includes/Revision/SlotRoleHandlerTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/SanitizerValidateEmailTest.php (renamed from tests/phpunit/unit/includes/SanitizerValidateEmailTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/ServiceWiringTest.php (renamed from tests/phpunit/unit/includes/ServiceWiringTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/SiteConfigurationTest.php (renamed from tests/phpunit/unit/includes/SiteConfigurationTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/Storage/BlobStoreFactoryTest.php (renamed from tests/phpunit/unit/includes/Storage/BlobStoreFactoryTest.php) | 30 | ||||
-rw-r--r-- | tests/phpunit/includes/Storage/PreparedEditTest.php (renamed from tests/phpunit/unit/includes/Storage/PreparedEditTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/TitleArrayFromResultTest.php (renamed from tests/phpunit/unit/includes/TitleArrayFromResultTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/WikiReferenceTest.php (renamed from tests/phpunit/unit/includes/WikiReferenceTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/XmlJsTest.php (renamed from tests/phpunit/unit/includes/XmlJsTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/XmlSelectTest.php (renamed from tests/phpunit/unit/includes/XmlSelectTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/actions/ViewActionTest.php (renamed from tests/phpunit/unit/includes/actions/ViewActionTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/api/ApiBlockInfoTraitTest.php | 43 | ||||
-rw-r--r-- | tests/phpunit/includes/api/ApiContinuationManagerTest.php (renamed from tests/phpunit/unit/includes/api/ApiContinuationManagerTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/api/ApiMessageTest.php (renamed from tests/phpunit/unit/includes/api/ApiMessageTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/api/ApiResultTest.php (renamed from tests/phpunit/unit/includes/api/ApiResultTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/api/ApiUsageExceptionTest.php (renamed from tests/phpunit/unit/includes/api/ApiUsageExceptionTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/auth/AbstractPreAuthenticationProviderTest.php (renamed from tests/phpunit/unit/includes/auth/AbstractPreAuthenticationProviderTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/auth/AbstractSecondaryAuthenticationProviderTest.php (renamed from tests/phpunit/unit/includes/auth/AbstractSecondaryAuthenticationProviderTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/auth/AuthenticationResponseTest.php (renamed from tests/phpunit/unit/includes/auth/AuthenticationResponseTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/auth/ConfirmLinkSecondaryAuthenticationProviderTest.php (renamed from tests/phpunit/unit/includes/auth/ConfirmLinkSecondaryAuthenticationProviderTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php (renamed from tests/phpunit/unit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php) | 29 | ||||
-rw-r--r-- | tests/phpunit/includes/changes/ChangesListFilterGroupTest.php (renamed from tests/phpunit/unit/includes/changes/ChangesListFilterGroupTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/collation/CustomUppercaseCollationTest.php (renamed from tests/phpunit/unit/includes/collation/CustomUppercaseCollationTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php (renamed from tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/config/ConfigFactoryTest.php (renamed from tests/phpunit/unit/includes/config/ConfigFactoryTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/config/EtcdConfigTest.php (renamed from tests/phpunit/unit/includes/config/EtcdConfigTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/config/HashConfigTest.php (renamed from tests/phpunit/unit/includes/config/HashConfigTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/config/MultiConfigTest.php (renamed from tests/phpunit/unit/includes/config/MultiConfigTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/config/ServiceOptionsTest.php (renamed from tests/phpunit/unit/includes/config/ServiceOptionsTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/content/JsonContentHandlerTest.php (renamed from tests/phpunit/unit/includes/content/JsonContentHandlerTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/db/DatabaseOracleTest.php (renamed from tests/phpunit/unit/includes/db/DatabaseOracleTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/debug/MWDebugTest.php (renamed from tests/phpunit/unit/includes/debug/MWDebugTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/debug/logger/MonologSpiTest.php (renamed from tests/phpunit/unit/includes/debug/logger/MonologSpiTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/debug/logger/monolog/AvroFormatterTest.php (renamed from tests/phpunit/unit/includes/debug/logger/monolog/AvroFormatterTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/debug/logger/monolog/CeeFormatterTest.php (renamed from tests/phpunit/unit/includes/debug/logger/monolog/CeeFormatterTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/debug/logger/monolog/KafkaHandlerTest.php (renamed from tests/phpunit/unit/includes/debug/logger/monolog/KafkaHandlerTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/debug/logger/monolog/LineFormatterTest.php (renamed from tests/phpunit/unit/includes/debug/logger/monolog/LineFormatterTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php (renamed from tests/phpunit/unit/includes/debug/logger/monolog/LogstashFormatterTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/deferred/MWCallableUpdateTest.php (renamed from tests/phpunit/unit/includes/deferred/MWCallableUpdateTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php (renamed from tests/phpunit/unit/includes/deferred/TransactionRoundDefiningUpdateTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/diff/ArrayDiffFormatterTest.php (renamed from tests/phpunit/unit/includes/diff/ArrayDiffFormatterTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/diff/DiffOpTest.php (renamed from tests/phpunit/unit/includes/diff/DiffOpTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/diff/DiffTest.php (renamed from tests/phpunit/unit/includes/diff/DiffTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/diff/DifferenceEngineSlotDiffRendererTest.php (renamed from tests/phpunit/unit/includes/diff/DifferenceEngineSlotDiffRendererTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/diff/SlotDiffRendererTest.php (renamed from tests/phpunit/unit/includes/diff/SlotDiffRendererTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/exception/HttpErrorTest.php (renamed from tests/phpunit/unit/includes/exception/HttpErrorTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/exception/MWExceptionHandlerTest.php (renamed from tests/phpunit/unit/includes/exception/MWExceptionHandlerTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/exception/ReadOnlyErrorTest.php | 16 | ||||
-rw-r--r-- | tests/phpunit/includes/exception/UserNotLoggedInTest.php (renamed from tests/phpunit/unit/includes/exception/UserNotLoggedInTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php (renamed from tests/phpunit/unit/includes/externalstore/ExternalStoreFactoryTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/filebackend/SwiftFileBackendTest.php (renamed from tests/phpunit/unit/includes/filebackend/SwiftFileBackendTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php (renamed from tests/phpunit/unit/includes/filerepo/FileBackendDBRepoWrapperTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/filerepo/FileRepoTest.php (renamed from tests/phpunit/unit/includes/filerepo/FileRepoTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php (renamed from tests/phpunit/unit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/htmlform/HTMLCheckMatrixTest.php (renamed from tests/phpunit/unit/includes/htmlform/HTMLCheckMatrixTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/htmlform/HTMLFormTest.php (renamed from tests/phpunit/unit/includes/htmlform/HTMLFormTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php (renamed from tests/phpunit/unit/includes/htmlform/HTMLRestrictionsFieldTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/http/GuzzleHttpRequestTest.php (renamed from tests/phpunit/unit/includes/http/GuzzleHttpRequestTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/http/HttpRequestFactoryTest.php (renamed from tests/phpunit/unit/includes/http/HttpRequestFactoryTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/installer/InstallDocFormatterTest.php (renamed from tests/phpunit/unit/includes/installer/InstallDocFormatterTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/installer/OracleInstallerTest.php (renamed from tests/phpunit/unit/includes/installer/OracleInstallerTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/interwiki/InterwikiLookupAdapterTest.php (renamed from tests/phpunit/unit/includes/interwiki/InterwikiLookupAdapterTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php (renamed from tests/phpunit/unit/includes/jobqueue/JobQueueMemoryTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/json/FormatJsonTest.php (renamed from tests/phpunit/unit/includes/json/FormatJsonTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/ArrayUtilsTest.php (renamed from tests/phpunit/unit/includes/libs/ArrayUtilsTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/CookieTest.php (renamed from tests/phpunit/unit/includes/libs/CookieTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/DeferredStringifierTest.php (renamed from tests/phpunit/unit/includes/libs/DeferredStringifierTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/DnsSrvDiscovererTest.php (renamed from tests/phpunit/unit/includes/libs/DnsSrvDiscovererTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/EasyDeflateTest.php (renamed from tests/phpunit/unit/includes/libs/EasyDeflateTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/GenericArrayObjectTest.php (renamed from tests/phpunit/unit/includes/libs/GenericArrayObjectTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/HashRingTest.php (renamed from tests/phpunit/unit/includes/libs/HashRingTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/HtmlArmorTest.php (renamed from tests/phpunit/unit/includes/libs/HtmlArmorTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/IEUrlExtensionTest.php (renamed from tests/phpunit/unit/includes/libs/IEUrlExtensionTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/IPTest.php (renamed from tests/phpunit/unit/includes/libs/IPTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/JavaScriptMinifierTest.php (renamed from tests/phpunit/unit/includes/libs/JavaScriptMinifierTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/MapCacheLRUTest.php (renamed from tests/phpunit/unit/includes/libs/MapCacheLRUTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/MemoizedCallableTest.php (renamed from tests/phpunit/unit/includes/libs/MemoizedCallableTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/ProcessCacheLRUTest.php (renamed from tests/phpunit/unit/includes/libs/ProcessCacheLRUTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/SamplingStatsdClientTest.php (renamed from tests/phpunit/unit/includes/libs/SamplingStatsdClientTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/StaticArrayWriterTest.php (renamed from tests/phpunit/unit/includes/libs/StaticArrayWriterTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/StringUtilsTest.php (renamed from tests/phpunit/unit/includes/libs/StringUtilsTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/TimingTest.php (renamed from tests/phpunit/unit/includes/libs/TimingTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/XhprofDataTest.php (renamed from tests/phpunit/unit/includes/libs/XhprofDataTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/XhprofTest.php (renamed from tests/phpunit/unit/includes/libs/XhprofTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/XmlTypeCheckTest.php (renamed from tests/phpunit/unit/includes/libs/XmlTypeCheckTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/composer/ComposerInstalledTest.php (renamed from tests/phpunit/unit/includes/libs/composer/ComposerInstalledTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/composer/ComposerJsonTest.php (renamed from tests/phpunit/unit/includes/libs/composer/ComposerJsonTest.php) | 4 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/composer/ComposerLockTest.php (renamed from tests/phpunit/unit/includes/libs/composer/ComposerLockTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/http/HttpAcceptNegotiatorTest.php (renamed from tests/phpunit/unit/includes/libs/http/HttpAcceptNegotiatorTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/http/HttpAcceptParserTest.php (renamed from tests/phpunit/unit/includes/libs/http/HttpAcceptParserTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/mime/MSCompoundFileReaderTest.php (renamed from tests/phpunit/unit/includes/libs/mime/MSCompoundFileReaderTest.php) | 11 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php (renamed from tests/phpunit/unit/includes/libs/mime/MimeAnalyzerTest.php) | 22 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/objectcache/CachedBagOStuffTest.php (renamed from tests/phpunit/unit/includes/libs/objectcache/CachedBagOStuffTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php (renamed from tests/phpunit/unit/includes/libs/objectcache/HashBagOStuffTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/objectcache/ReplicatedBagOStuffTest.php (renamed from tests/phpunit/unit/includes/libs/objectcache/ReplicatedBagOStuffTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php (renamed from tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/ChronologyProtectorTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/ChronologyProtectorTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/TransactionProfilerTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/database/DBConnRefTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/database/DatabaseDomainTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/database/DatabaseDomainTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/database/DatabaseMssqlTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/database/DatabaseMssqlTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/database/DatabaseSQLTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/database/DatabaseSqliteRdbmsTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/database/DatabaseSqliteRdbmsTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php (renamed from tests/phpunit/unit/includes/libs/rdbms/database/DatabaseTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/services/ServiceContainerTest.php (renamed from tests/phpunit/unit/includes/libs/services/ServiceContainerTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/services/TestWiring1.php (renamed from tests/phpunit/unit/includes/libs/services/TestWiring1.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/services/TestWiring2.php (renamed from tests/phpunit/unit/includes/libs/services/TestWiring2.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/stats/PrefixingStatsdDataFactoryProxyTest.php (renamed from tests/phpunit/unit/includes/libs/stats/PrefixingStatsdDataFactoryProxyTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/media/GIFMetadataExtractorTest.php (renamed from tests/phpunit/unit/includes/media/GIFMetadataExtractorTest.php) | 4 | ||||
-rw-r--r-- | tests/phpunit/includes/media/IPTCTest.php (renamed from tests/phpunit/unit/includes/media/IPTCTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/media/JpegMetadataExtractorTest.php (renamed from tests/phpunit/unit/includes/media/JpegMetadataExtractorTest.php) | 4 | ||||
-rw-r--r-- | tests/phpunit/includes/media/MediaHandlerTest.php (renamed from tests/phpunit/unit/includes/media/MediaHandlerTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/media/SVGMetadataExtractorTest.php (renamed from tests/phpunit/unit/includes/media/SVGMetadataExtractorTest.php) | 6 | ||||
-rw-r--r-- | tests/phpunit/includes/media/WebPHandlerTest.php (renamed from tests/phpunit/unit/includes/media/WebPHandlerTest.php) | 18 | ||||
-rw-r--r-- | tests/phpunit/includes/objectcache/MemcachedBagOStuffTest.php (renamed from tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/objectcache/RESTBagOStuffTest.php (renamed from tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/objectcache/RedisBagOStuffTest.php (renamed from tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/page/ArticleTest.php (renamed from tests/phpunit/unit/includes/page/ArticleTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/parser/ParserPreloadTest.php (renamed from tests/phpunit/unit/includes/parser/ParserPreloadTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/parser/PreprocessorTest.php (renamed from tests/phpunit/unit/includes/parser/PreprocessorTest.php) | 4 | ||||
-rw-r--r-- | tests/phpunit/includes/parser/TidyTest.php (renamed from tests/phpunit/unit/includes/parser/TidyTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/password/PasswordFactoryTest.php (renamed from tests/phpunit/unit/includes/password/PasswordFactoryTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/password/PasswordTest.php (renamed from tests/phpunit/unit/includes/password/PasswordTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/preferences/FiltersTest.php (renamed from tests/phpunit/unit/includes/preferences/FiltersTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/registration/ExtensionJsonValidatorTest.php (renamed from tests/phpunit/unit/includes/registration/ExtensionJsonValidatorTest.php) | 4 | ||||
-rw-r--r-- | tests/phpunit/includes/registration/ExtensionProcessorTest.php (renamed from tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/registration/VersionCheckerTest.php (renamed from tests/phpunit/unit/includes/registration/VersionCheckerTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php (renamed from tests/phpunit/unit/includes/resourceloader/DerivativeResourceLoaderContextTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php (renamed from tests/phpunit/unit/includes/resourceloader/MessageBlobStoreTest.php) | 19 | ||||
-rw-r--r-- | tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php (renamed from tests/phpunit/unit/includes/resourceloader/ResourceLoaderClientHtmlTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php (renamed from tests/phpunit/unit/includes/resourceloader/ResourceLoaderContextTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/search/SearchIndexFieldTest.php (renamed from tests/phpunit/unit/includes/search/SearchIndexFieldTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/search/SearchSuggestionSetTest.php (renamed from tests/phpunit/unit/includes/search/SearchSuggestionSetTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/session/MetadataMergeExceptionTest.php (renamed from tests/phpunit/unit/includes/session/MetadataMergeExceptionTest.php) | 4 | ||||
-rw-r--r-- | tests/phpunit/includes/session/SessionIdTest.php (renamed from tests/phpunit/unit/includes/session/SessionIdTest.php) | 4 | ||||
-rw-r--r-- | tests/phpunit/includes/session/SessionInfoTest.php (renamed from tests/phpunit/unit/includes/session/SessionInfoTest.php) | 11 | ||||
-rw-r--r-- | tests/phpunit/includes/session/SessionProviderTest.php (renamed from tests/phpunit/unit/includes/session/SessionProviderTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/session/SessionTest.php (renamed from tests/phpunit/unit/includes/session/SessionTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/session/TokenTest.php (renamed from tests/phpunit/unit/includes/session/TokenTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/includes/shell/CommandFactoryTest.php (renamed from tests/phpunit/unit/includes/shell/CommandFactoryTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/shell/CommandTest.php (renamed from tests/phpunit/unit/includes/shell/CommandTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/shell/FirejailCommandTest.php (renamed from tests/phpunit/unit/includes/shell/FirejailCommandTest.php) | 5 | ||||
-rw-r--r-- | tests/phpunit/includes/site/CachingSiteStoreTest.php (renamed from tests/phpunit/unit/includes/site/CachingSiteStoreTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/site/HashSiteStoreTest.php (renamed from tests/phpunit/unit/includes/site/HashSiteStoreTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/site/MediaWikiPageNameNormalizerTest.php (renamed from tests/phpunit/unit/includes/site/MediaWikiPageNameNormalizerTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/site/SiteExporterTest.php (renamed from tests/phpunit/unit/includes/site/SiteExporterTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/site/SiteImporterTest.php (renamed from tests/phpunit/unit/includes/site/SiteImporterTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/site/SiteImporterTest.xml (renamed from tests/phpunit/unit/includes/site/SiteImporterTest.xml) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/skins/SkinFactoryTest.php (renamed from tests/phpunit/unit/includes/skins/SkinFactoryTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/skins/SkinTemplateTest.php (renamed from tests/phpunit/unit/includes/skins/SkinTemplateTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/skins/SkinTest.php (renamed from tests/phpunit/unit/includes/skins/SkinTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/sparql/SparqlClientTest.php (renamed from tests/phpunit/unit/includes/sparql/SparqlClientTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/specials/ImageListPagerTest.php (renamed from tests/phpunit/unit/includes/specials/ImageListPagerTest.php) | 8 | ||||
-rw-r--r-- | tests/phpunit/includes/specials/SpecialUploadTest.php (renamed from tests/phpunit/unit/includes/specials/SpecialUploadTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/specials/UncategorizedCategoriesPageTest.php (renamed from tests/phpunit/unit/includes/specials/UncategorizedCategoriesPageTest.php) | 19 | ||||
-rw-r--r-- | tests/phpunit/includes/tidy/RemexDriverTest.php (renamed from tests/phpunit/unit/includes/tidy/RemexDriverTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/tidy/html5lib-tests.json (renamed from tests/phpunit/unit/includes/tidy/html5lib-tests.json) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/title/ForeignTitleTest.php (renamed from tests/phpunit/unit/includes/title/ForeignTitleTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/title/NaiveForeignTitleFactoryTest.php (renamed from tests/phpunit/unit/includes/title/NaiveForeignTitleFactoryTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/title/NamespaceAwareForeignTitleFactoryTest.php (renamed from tests/phpunit/unit/includes/title/NamespaceAwareForeignTitleFactoryTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/title/TitleValueTest.php (renamed from tests/phpunit/unit/includes/title/TitleValueTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/user/UserArrayFromResultTest.php (renamed from tests/phpunit/unit/includes/user/UserArrayFromResultTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/utils/AvroValidatorTest.php (renamed from tests/phpunit/unit/includes/utils/AvroValidatorTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/utils/BatchRowUpdateTest.php (renamed from tests/phpunit/unit/includes/utils/BatchRowUpdateTest.php) | 19 | ||||
-rw-r--r-- | tests/phpunit/includes/utils/ClassCollectorTest.php (renamed from tests/phpunit/unit/includes/utils/ClassCollectorTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/utils/FileContentsHasherTest.php (renamed from tests/phpunit/unit/includes/utils/FileContentsHasherTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/utils/MWCryptHashTest.php (renamed from tests/phpunit/unit/includes/utils/MWCryptHashTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/utils/MWRestrictionsTest.php (renamed from tests/phpunit/unit/includes/utils/MWRestrictionsTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/utils/UIDGeneratorTest.php (renamed from tests/phpunit/unit/includes/utils/UIDGeneratorTest.php) | 0 | ||||
-rw-r--r-- | tests/phpunit/includes/utils/ZipDirectoryReaderTest.php (renamed from tests/phpunit/unit/includes/utils/ZipDirectoryReaderTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php (renamed from tests/phpunit/unit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/languages/SpecialPageAliasTest.php (renamed from tests/phpunit/unit/languages/SpecialPageAliasTest.php) | 2 | ||||
-rw-r--r-- | tests/phpunit/structure/ApiPrefixUniquenessTest.php (renamed from tests/phpunit/unit/structure/ApiPrefixUniquenessTest.php) | 3 | ||||
-rw-r--r-- | tests/phpunit/structure/AutoLoaderStructureTest.php (renamed from tests/phpunit/unit/structure/AutoLoaderStructureTest.php) | 8 | ||||
-rw-r--r-- | tests/phpunit/structure/ContentHandlerSanityTest.php (renamed from tests/phpunit/unit/structure/ContentHandlerSanityTest.php) | 5 | ||||
-rw-r--r-- | tests/phpunit/structure/PasswordPolicyStructureTest.php (renamed from tests/phpunit/unit/structure/PasswordPolicyStructureTest.php) | 5 | ||||
-rw-r--r-- | tests/phpunit/structure/StructureTest.php | 1 | ||||
-rw-r--r-- | tests/phpunit/suite.xml | 11 | ||||
-rw-r--r-- | tests/phpunit/unit-tests.xml | 49 | ||||
-rw-r--r-- | tests/phpunit/unit/includes/api/ApiBlockInfoTraitTest.php | 66 | ||||
-rw-r--r-- | tests/phpunit/unit/includes/exception/ReadOnlyErrorTest.php | 25 | ||||
-rw-r--r-- | tests/phpunit/unit/initUnitTests.php | 56 |
218 files changed, 242 insertions, 550 deletions
diff --git a/tests/common/TestSetup.php b/tests/common/TestSetup.php index 6d250be096fa..e24c4c544253 100644 --- a/tests/common/TestSetup.php +++ b/tests/common/TestSetup.php @@ -18,9 +18,6 @@ class TestSetup { global $wgSessionProviders, $wgSessionPbkdf2Iterations; global $wgJobTypeConf; global $wgAuthManagerConfig; - global $wgSecretKey; - - $wgSecretKey = 'secretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecret'; // wfWarn should cause tests to fail $wgDevelopmentWarnings = true; diff --git a/tests/common/TestsAutoLoader.php b/tests/common/TestsAutoLoader.php index 3eb8c9a7216b..861111a77574 100644 --- a/tests/common/TestsAutoLoader.php +++ b/tests/common/TestsAutoLoader.php @@ -60,7 +60,6 @@ $wgAutoloadClasses += [ 'MediaWikiPHPUnitResultPrinter' => "$testDir/phpunit/MediaWikiPHPUnitResultPrinter.php", 'MediaWikiPHPUnitTestListener' => "$testDir/phpunit/MediaWikiPHPUnitTestListener.php", 'MediaWikiTestCase' => "$testDir/phpunit/MediaWikiTestCase.php", - 'MediaWikiUnitTestCase' => "$testDir/phpunit/MediaWikiUnitTestCase.php", 'MediaWikiTestResult' => "$testDir/phpunit/MediaWikiTestResult.php", 'MediaWikiTestRunner' => "$testDir/phpunit/MediaWikiTestRunner.php", 'PHPUnit4And6Compat' => "$testDir/phpunit/PHPUnit4And6Compat.php", @@ -178,7 +177,7 @@ $wgAutoloadClasses += [ 'LanguageClassesTestCase' => "$testDir/phpunit/languages/LanguageClassesTestCase.php", # tests/phpunit/includes/libs - 'GenericArrayObjectTest' => "$testDir/phpunit/unit/includes/libs/GenericArrayObjectTest.php", + 'GenericArrayObjectTest' => "$testDir/phpunit/includes/libs/GenericArrayObjectTest.php", # tests/phpunit/maintenance 'MediaWiki\Tests\Maintenance\DumpAsserter' => "$testDir/phpunit/maintenance/DumpAsserter.php", diff --git a/tests/phpunit/MediaWikiUnitTestCase.php b/tests/phpunit/MediaWikiUnitTestCase.php deleted file mode 100644 index 9ecc0431871f..000000000000 --- a/tests/phpunit/MediaWikiUnitTestCase.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -use MediaWiki\MediaWikiServices; -use PHPUnit\Framework\TestCase; - -abstract class MediaWikiUnitTestCase extends TestCase { - use MediaWikiCoversValidator; - use PHPUnit4And6Compat; - - /** @var MediaWikiServices $mwServicesBackup */ - private $mwServicesBackup; - - /** - * Replace global MediaWiki service locator with a clone that has the given overrides applied - * @param callable[] $overrides map of service names to instantiators - * @throws MWException - */ - protected function overrideMwServices( array $overrides ) { - $services = clone MediaWikiServices::getInstance(); - - foreach ( $overrides as $serviceName => $factory ) { - $services->disableService( $serviceName ); - $services->redefineService( $serviceName, $factory ); - } - - $this->mwServicesBackup = MediaWikiServices::forceGlobalInstance( $services ); - } - - protected function tearDown() { - parent::tearDown(); - - if ( $this->mwServicesBackup ) { - MediaWikiServices::forceGlobalInstance( $this->mwServicesBackup ); - } - } -} diff --git a/tests/phpunit/unit/documentation/ReleaseNotesTest.php b/tests/phpunit/documentation/ReleaseNotesTest.php index 701cb56635b7..d20fcff7b870 100644 --- a/tests/phpunit/unit/documentation/ReleaseNotesTest.php +++ b/tests/phpunit/documentation/ReleaseNotesTest.php @@ -3,7 +3,7 @@ /** * James doesn't like having to manually fix these things. */ -class ReleaseNotesTest extends \MediaWikiUnitTestCase { +class ReleaseNotesTest extends MediaWikiTestCase { /** * Verify that at least one Release Notes file exists, have content, and * aren't overly long. diff --git a/tests/phpunit/unit/includes/CommentStoreCommentTest.php b/tests/phpunit/includes/CommentStoreCommentTest.php index 2dfe03ad6b81..2dfe03ad6b81 100644 --- a/tests/phpunit/unit/includes/CommentStoreCommentTest.php +++ b/tests/phpunit/includes/CommentStoreCommentTest.php diff --git a/tests/phpunit/unit/includes/DerivativeRequestTest.php b/tests/phpunit/includes/DerivativeRequestTest.php index f33022b3526f..f33022b3526f 100644 --- a/tests/phpunit/unit/includes/DerivativeRequestTest.php +++ b/tests/phpunit/includes/DerivativeRequestTest.php diff --git a/tests/phpunit/unit/includes/FauxRequestTest.php b/tests/phpunit/includes/FauxRequestTest.php index c054caa06f7f..c054caa06f7f 100644 --- a/tests/phpunit/unit/includes/FauxRequestTest.php +++ b/tests/phpunit/includes/FauxRequestTest.php diff --git a/tests/phpunit/unit/includes/FauxResponseTest.php b/tests/phpunit/includes/FauxResponseTest.php index 5e208aceda2b..8085bc710ce5 100644 --- a/tests/phpunit/unit/includes/FauxResponseTest.php +++ b/tests/phpunit/includes/FauxResponseTest.php @@ -20,7 +20,7 @@ * @file */ -class FauxResponseTest extends \MediaWikiUnitTestCase { +class FauxResponseTest extends MediaWikiTestCase { /** @var FauxResponse */ protected $response; diff --git a/tests/phpunit/unit/includes/FormOptionsInitializationTest.php b/tests/phpunit/includes/FormOptionsInitializationTest.php index 708956d260f1..2c78618aa1dc 100644 --- a/tests/phpunit/unit/includes/FormOptionsInitializationTest.php +++ b/tests/phpunit/includes/FormOptionsInitializationTest.php @@ -10,7 +10,7 @@ use Wikimedia\TestingAccessWrapper; * * @author Antoine Musso */ -class FormOptionsInitializationTest extends \MediaWikiUnitTestCase { +class FormOptionsInitializationTest extends MediaWikiTestCase { /** * @var FormOptions */ diff --git a/tests/phpunit/unit/includes/FormOptionsTest.php b/tests/phpunit/includes/FormOptionsTest.php index c14595bc4abb..da08670f57be 100644 --- a/tests/phpunit/unit/includes/FormOptionsTest.php +++ b/tests/phpunit/includes/FormOptionsTest.php @@ -15,7 +15,7 @@ * * @author Antoine Musso */ -class FormOptionsTest extends \MediaWikiUnitTestCase { +class FormOptionsTest extends MediaWikiTestCase { /** * @var FormOptions */ diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfAppendQueryTest.php b/tests/phpunit/includes/GlobalFunctions/wfAppendQueryTest.php index 27ac239b827c..bb71610b64e7 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfAppendQueryTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfAppendQueryTest.php @@ -4,7 +4,7 @@ * @group GlobalFunctions * @covers ::wfAppendQuery */ -class WfAppendQueryTest extends \MediaWikiUnitTestCase { +class WfAppendQueryTest extends MediaWikiTestCase { /** * @dataProvider provideAppendQuery */ diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfArrayPlus2dTest.php b/tests/phpunit/includes/GlobalFunctions/wfArrayPlus2dTest.php index 3e65af52126c..65b56ef4b351 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfArrayPlus2dTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfArrayPlus2dTest.php @@ -3,7 +3,7 @@ * @group GlobalFunctions * @covers ::wfArrayPlus2d */ -class WfArrayPlus2dTest extends \MediaWikiUnitTestCase { +class WfArrayPlus2dTest extends MediaWikiTestCase { /** * @dataProvider provideArrays */ diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfAssembleUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php index f28646eb3a6f..7ddad369bd41 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfAssembleUrlTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php @@ -3,7 +3,7 @@ * @group GlobalFunctions * @covers ::wfAssembleUrl */ -class WfAssembleUrlTest extends \MediaWikiUnitTestCase { +class WfAssembleUrlTest extends MediaWikiTestCase { /** * @dataProvider provideURLParts */ diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfBaseNameTest.php b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php index ac42f3f82d38..78e09e60baeb 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfBaseNameTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php @@ -3,7 +3,7 @@ * @group GlobalFunctions * @covers ::wfBaseName */ -class WfBaseNameTest extends \MediaWikiUnitTestCase { +class WfBaseNameTest extends MediaWikiTestCase { /** * @dataProvider providePaths */ diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfEscapeShellArgTest.php b/tests/phpunit/includes/GlobalFunctions/wfEscapeShellArgTest.php index 7e818dfbda1d..7402054ea40b 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfEscapeShellArgTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfEscapeShellArgTest.php @@ -4,7 +4,7 @@ * @group GlobalFunctions * @covers ::wfEscapeShellArg */ -class WfEscapeShellArgTest extends \MediaWikiUnitTestCase { +class WfEscapeShellArgTest extends MediaWikiTestCase { public function testSingleInput() { if ( wfIsWindows() ) { $expected = '"blah"'; diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfGetCallerTest.php b/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php index c77c35133cd9..8a7bfa5a8cf3 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfGetCallerTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php @@ -4,7 +4,7 @@ * @group GlobalFunctions * @covers ::wfGetCaller */ -class WfGetCallerTest extends \MediaWikiUnitTestCase { +class WfGetCallerTest extends MediaWikiTestCase { public function testZero() { $this->assertEquals( 'WfGetCallerTest->testZero', wfGetCaller( 1 ) ); } diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php b/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php index 085bfed3d386..eae5588b942e 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php @@ -4,7 +4,7 @@ * @group GlobalFunctions * @covers ::wfRemoveDotSegments */ -class WfRemoveDotSegmentsTest extends \MediaWikiUnitTestCase { +class WfRemoveDotSegmentsTest extends MediaWikiTestCase { /** * @dataProvider providePaths */ diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfShellExecTest.php b/tests/phpunit/includes/GlobalFunctions/wfShellExecTest.php index 09ce624dc1f7..6279cf6eee8f 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfShellExecTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfShellExecTest.php @@ -4,7 +4,7 @@ * @group GlobalFunctions * @covers ::wfShellExec */ -class WfShellExecTest extends \MediaWikiUnitTestCase { +class WfShellExecTest extends MediaWikiTestCase { public function testT69870() { $command = wfIsWindows() // 333 = 331 + CRLF diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfShorthandToIntegerTest.php b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php index 3bb8b985a70e..40b2e636c91a 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfShorthandToIntegerTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php @@ -4,7 +4,7 @@ * @group GlobalFunctions * @covers ::wfShorthandToInteger */ -class WfShorthandToIntegerTest extends \MediaWikiUnitTestCase { +class WfShorthandToIntegerTest extends MediaWikiTestCase { /** * @dataProvider provideABunchOfShorthands */ diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfStringToBoolTest.php b/tests/phpunit/includes/GlobalFunctions/wfStringToBoolTest.php index bc010d5b5058..7f56b60529c6 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfStringToBoolTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfStringToBoolTest.php @@ -4,7 +4,7 @@ * @group GlobalFunctions * @covers ::wfStringToBool */ -class WfStringToBoolTest extends \MediaWikiUnitTestCase { +class WfStringToBoolTest extends MediaWikiTestCase { public function getTestCases() { return [ diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfTimestampTest.php b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php index 78b9172c6e76..a70f136a1c17 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfTimestampTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php @@ -4,7 +4,7 @@ * @group GlobalFunctions * @covers ::wfTimestamp */ -class WfTimestampTest extends \MediaWikiUnitTestCase { +class WfTimestampTest extends MediaWikiTestCase { /** * @dataProvider provideNormalTimestamps */ diff --git a/tests/phpunit/unit/includes/GlobalFunctions/wfUrlencodeTest.php b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php index a5992d4c839f..5d9f63daa71c 100644 --- a/tests/phpunit/unit/includes/GlobalFunctions/wfUrlencodeTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php @@ -6,7 +6,7 @@ * @group GlobalFunctions * @covers ::wfUrlencode */ -class WfUrlencodeTest extends \MediaWikiUnitTestCase { +class WfUrlencodeTest extends MediaWikiTestCase { # ### TESTS ############################################################## /** diff --git a/tests/phpunit/unit/includes/HooksTest.php b/tests/phpunit/includes/HooksTest.php index 9380546c84fe..c66b712b8355 100644 --- a/tests/phpunit/unit/includes/HooksTest.php +++ b/tests/phpunit/includes/HooksTest.php @@ -1,6 +1,6 @@ <?php -class HooksTest extends \MediaWikiUnitTestCase { +class HooksTest extends MediaWikiTestCase { function setUp() { global $wgHooks; diff --git a/tests/phpunit/unit/includes/LicensesTest.php b/tests/phpunit/includes/LicensesTest.php index e5a6baeff6e0..0e96bf44eec5 100644 --- a/tests/phpunit/unit/includes/LicensesTest.php +++ b/tests/phpunit/includes/LicensesTest.php @@ -3,7 +3,7 @@ /** * @covers Licenses */ -class LicensesTest extends \MediaWikiUnitTestCase { +class LicensesTest extends MediaWikiTestCase { public function testLicenses() { $str = " diff --git a/tests/phpunit/unit/includes/ListToggleTest.php b/tests/phpunit/includes/ListToggleTest.php index 0ff65bbc8c98..3574545e456f 100644 --- a/tests/phpunit/unit/includes/ListToggleTest.php +++ b/tests/phpunit/includes/ListToggleTest.php @@ -3,7 +3,7 @@ /** * @covers ListToggle */ -class ListToggleTest extends \MediaWikiUnitTestCase { +class ListToggleTest extends MediaWikiTestCase { /** * @covers ListToggle::__construct diff --git a/tests/phpunit/unit/includes/MagicWordFactoryTest.php b/tests/phpunit/includes/MagicWordFactoryTest.php index 14a47279fffd..065024bd73be 100644 --- a/tests/phpunit/unit/includes/MagicWordFactoryTest.php +++ b/tests/phpunit/includes/MagicWordFactoryTest.php @@ -5,7 +5,7 @@ * * @author Derick N. Alangi */ -class MagicWordFactoryTest extends \MediaWikiUnitTestCase { +class MagicWordFactoryTest extends MediaWikiTestCase { private function makeMagicWordFactory( Language $contLang = null ) { return new MagicWordFactory( $contLang ?: Language::factory( 'en' ) ); } diff --git a/tests/phpunit/unit/includes/MediaWikiServicesTest.php b/tests/phpunit/includes/MediaWikiServicesTest.php index c89c820401be..8fa0cd60ec14 100644 --- a/tests/phpunit/unit/includes/MediaWikiServicesTest.php +++ b/tests/phpunit/includes/MediaWikiServicesTest.php @@ -10,7 +10,7 @@ use Wikimedia\Services\ServiceDisabledException; * * @group MediaWiki */ -class MediaWikiServicesTest extends \MediaWikiUnitTestCase { +class MediaWikiServicesTest extends MediaWikiTestCase { private $deprecatedServices = []; /** @@ -292,8 +292,8 @@ class MediaWikiServicesTest extends \MediaWikiUnitTestCase { $this->hideDeprecated( MediaWikiServices::class . "::$getter" ); } - // Check all services via an instance using the global configuration, not a dummy instance! - $services = $this->newMediaWikiServices( new GlobalVarConfig() ); + // Test against the default instance, since the dummy will not know the default services. + $services = MediaWikiServices::getInstance(); $service = $services->$getter(); $this->assertInstanceOf( $type, $service ); } @@ -317,18 +317,18 @@ class MediaWikiServicesTest extends \MediaWikiUnitTestCase { * @dataProvider provideGetService */ public function testGetService( $name, $type ) { - // Check all services via an instance using the global configuration, not a dummy instance! - $services = $this->newMediaWikiServices( new GlobalVarConfig() ); + // Test against the default instance, since the dummy will not know the default services. + $services = MediaWikiServices::getInstance(); $service = $services->getService( $name ); $this->assertInstanceOf( $type, $service ); } public function testDefaultServiceInstantiation() { - // Check all services via an instance using the global configuration, not a dummy instance! + // Check all services in the default instance, not a dummy instance! // Note that we instantiate all services here, including any that // were registered by extensions. - $services = $this->newMediaWikiServices( new GlobalVarConfig() ); + $services = MediaWikiServices::getInstance(); $names = $services->getServiceNames(); foreach ( $names as $name ) { diff --git a/tests/phpunit/unit/includes/MediaWikiVersionFetcherTest.php b/tests/phpunit/includes/MediaWikiVersionFetcherTest.php index dfdbfa734452..9803081869cd 100644 --- a/tests/phpunit/unit/includes/MediaWikiVersionFetcherTest.php +++ b/tests/phpunit/includes/MediaWikiVersionFetcherTest.php @@ -10,7 +10,7 @@ * * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ -class MediaWikiVersionFetcherTest extends \MediaWikiUnitTestCase { +class MediaWikiVersionFetcherTest extends MediaWikiTestCase { public function testReturnsResult() { global $wgVersion; diff --git a/tests/phpunit/unit/includes/PathRouterTest.php b/tests/phpunit/includes/PathRouterTest.php index 0cb6c81822c2..d8916751c081 100644 --- a/tests/phpunit/unit/includes/PathRouterTest.php +++ b/tests/phpunit/includes/PathRouterTest.php @@ -5,7 +5,7 @@ * * @covers PathRouter */ -class PathRouterTest extends \MediaWikiUnitTestCase { +class PathRouterTest extends MediaWikiTestCase { /** * @var PathRouter diff --git a/tests/phpunit/unit/includes/Revision/FallbackSlotRoleHandlerTest.php b/tests/phpunit/includes/Revision/FallbackSlotRoleHandlerTest.php index 9b23c6e17eb3..aedf292eca35 100644 --- a/tests/phpunit/unit/includes/Revision/FallbackSlotRoleHandlerTest.php +++ b/tests/phpunit/includes/Revision/FallbackSlotRoleHandlerTest.php @@ -3,12 +3,13 @@ namespace MediaWiki\Tests\Revision; use MediaWiki\Revision\FallbackSlotRoleHandler; +use MediaWikiTestCase; use Title; /** * @covers \MediaWiki\Revision\FallbackSlotRoleHandler */ -class FallbackSlotRoleHandlerTest extends \MediaWikiUnitTestCase { +class FallbackSlotRoleHandlerTest extends MediaWikiTestCase { private function makeBlankTitleObject() { /** @var Title $title */ diff --git a/tests/phpunit/unit/includes/Revision/MainSlotRoleHandlerTest.php b/tests/phpunit/includes/Revision/MainSlotRoleHandlerTest.php index afd748f7613f..5e32574d4018 100644 --- a/tests/phpunit/unit/includes/Revision/MainSlotRoleHandlerTest.php +++ b/tests/phpunit/includes/Revision/MainSlotRoleHandlerTest.php @@ -3,13 +3,14 @@ namespace MediaWiki\Tests\Revision; use MediaWiki\Revision\MainSlotRoleHandler; +use MediaWikiTestCase; use PHPUnit\Framework\MockObject\MockObject; use Title; /** * @covers \MediaWiki\Revision\MainSlotRoleHandler */ -class MainSlotRoleHandlerTest extends \MediaWikiUnitTestCase { +class MainSlotRoleHandlerTest extends MediaWikiTestCase { private function makeTitleObject( $ns ) { /** @var Title|MockObject $title */ diff --git a/tests/phpunit/unit/includes/Revision/RevisionStoreFactoryTest.php b/tests/phpunit/includes/Revision/RevisionStoreFactoryTest.php index 77228081d03a..138d6bcba1f5 100644 --- a/tests/phpunit/unit/includes/Revision/RevisionStoreFactoryTest.php +++ b/tests/phpunit/includes/Revision/RevisionStoreFactoryTest.php @@ -13,6 +13,7 @@ use MediaWiki\Storage\BlobStoreFactory; use MediaWiki\Storage\NameTableStore; use MediaWiki\Storage\NameTableStoreFactory; use MediaWiki\Storage\SqlBlobStore; +use MediaWikiTestCase; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; use WANObjectCache; @@ -20,7 +21,7 @@ use Wikimedia\Rdbms\ILBFactory; use Wikimedia\Rdbms\ILoadBalancer; use Wikimedia\TestingAccessWrapper; -class RevisionStoreFactoryTest extends \MediaWikiUnitTestCase { +class RevisionStoreFactoryTest extends MediaWikiTestCase { /** * @covers \MediaWiki\Revision\RevisionStoreFactory::__construct diff --git a/tests/phpunit/unit/includes/Revision/SlotRecordTest.php b/tests/phpunit/includes/Revision/SlotRecordTest.php index 58c1035231eb..1b6ff2aaceda 100644 --- a/tests/phpunit/unit/includes/Revision/SlotRecordTest.php +++ b/tests/phpunit/includes/Revision/SlotRecordTest.php @@ -7,12 +7,13 @@ use LogicException; use MediaWiki\Revision\IncompleteRevisionException; use MediaWiki\Revision\SlotRecord; use MediaWiki\Revision\SuppressedDataException; +use MediaWikiTestCase; use WikitextContent; /** * @covers \MediaWiki\Revision\SlotRecord */ -class SlotRecordTest extends \MediaWikiUnitTestCase { +class SlotRecordTest extends MediaWikiTestCase { private function makeRow( $data = [] ) { $data = $data + [ diff --git a/tests/phpunit/unit/includes/Revision/SlotRoleHandlerTest.php b/tests/phpunit/includes/Revision/SlotRoleHandlerTest.php index ed3053c0707d..67e9464f3322 100644 --- a/tests/phpunit/unit/includes/Revision/SlotRoleHandlerTest.php +++ b/tests/phpunit/includes/Revision/SlotRoleHandlerTest.php @@ -3,12 +3,13 @@ namespace MediaWiki\Tests\Revision; use MediaWiki\Revision\SlotRoleHandler; +use MediaWikiTestCase; use Title; /** * @covers \MediaWiki\Revision\SlotRoleHandler */ -class SlotRoleHandlerTest extends \MediaWikiUnitTestCase { +class SlotRoleHandlerTest extends MediaWikiTestCase { private function makeBlankTitleObject() { /** @var Title $title */ diff --git a/tests/phpunit/unit/includes/SanitizerValidateEmailTest.php b/tests/phpunit/includes/SanitizerValidateEmailTest.php index c4e430848bc9..c4e430848bc9 100644 --- a/tests/phpunit/unit/includes/SanitizerValidateEmailTest.php +++ b/tests/phpunit/includes/SanitizerValidateEmailTest.php diff --git a/tests/phpunit/unit/includes/ServiceWiringTest.php b/tests/phpunit/includes/ServiceWiringTest.php index 25b0214db139..02e06f8ddaa0 100644 --- a/tests/phpunit/unit/includes/ServiceWiringTest.php +++ b/tests/phpunit/includes/ServiceWiringTest.php @@ -3,7 +3,7 @@ /** * @coversNothing */ -class ServiceWiringTest extends \MediaWikiUnitTestCase { +class ServiceWiringTest extends MediaWikiTestCase { public function testServicesAreSorted() { global $IP; $services = array_keys( require "$IP/includes/ServiceWiring.php" ); diff --git a/tests/phpunit/unit/includes/SiteConfigurationTest.php b/tests/phpunit/includes/SiteConfigurationTest.php index b992a86471e8..3b7226245fcd 100644 --- a/tests/phpunit/unit/includes/SiteConfigurationTest.php +++ b/tests/phpunit/includes/SiteConfigurationTest.php @@ -1,6 +1,6 @@ <?php -class SiteConfigurationTest extends \MediaWikiUnitTestCase { +class SiteConfigurationTest extends MediaWikiTestCase { /** * @var SiteConfiguration diff --git a/tests/phpunit/unit/includes/Storage/BlobStoreFactoryTest.php b/tests/phpunit/includes/Storage/BlobStoreFactoryTest.php index a94214febbce..252c6578670c 100644 --- a/tests/phpunit/unit/includes/Storage/BlobStoreFactoryTest.php +++ b/tests/phpunit/includes/Storage/BlobStoreFactoryTest.php @@ -5,28 +5,13 @@ namespace MediaWiki\Tests\Storage; use MediaWiki\MediaWikiServices; use MediaWiki\Storage\BlobStore; use MediaWiki\Storage\SqlBlobStore; -use Wikimedia\Rdbms\LBFactory; +use MediaWikiTestCase; use Wikimedia\TestingAccessWrapper; /** * @covers \MediaWiki\Storage\BlobStoreFactory */ -class BlobStoreFactoryTest extends \MediaWikiUnitTestCase { - - /** @var LBFactory|\PHPUnit_Framework_MockObject_MockObject $lbFactoryMock */ - private $lbFactoryMock; - - protected function setUp() { - parent::setUp(); - - $this->lbFactoryMock = $this->createMock( LBFactory::class ); - - $lbFactoryMockProvider = function (): LBFactory { - return $this->lbFactoryMock; - }; - - $this->overrideMwServices( [ 'DBLoadBalancerFactory' => $lbFactoryMockProvider ] ); - } +class BlobStoreFactoryTest extends MediaWikiTestCase { public function provideWikiIds() { yield [ false ]; @@ -37,11 +22,6 @@ class BlobStoreFactoryTest extends \MediaWikiUnitTestCase { * @dataProvider provideWikiIds */ public function testNewBlobStore( $wikiId ) { - $this->lbFactoryMock->expects( $this->any() ) - ->method( 'getMainLB' ) - ->with( $wikiId ) - ->willReturn( $this->createMock( \LoadBalancer::class ) ); - $factory = MediaWikiServices::getInstance()->getBlobStoreFactory(); $store = $factory->newBlobStore( $wikiId ); $this->assertInstanceOf( BlobStore::class, $store ); @@ -55,11 +35,6 @@ class BlobStoreFactoryTest extends \MediaWikiUnitTestCase { * @dataProvider provideWikiIds */ public function testNewSqlBlobStore( $wikiId ) { - $this->lbFactoryMock->expects( $this->any() ) - ->method( 'getMainLB' ) - ->with( $wikiId ) - ->willReturn( $this->createMock( \LoadBalancer::class ) ); - $factory = MediaWikiServices::getInstance()->getBlobStoreFactory(); $store = $factory->newSqlBlobStore( $wikiId ); $this->assertInstanceOf( SqlBlobStore::class, $store ); @@ -67,4 +42,5 @@ class BlobStoreFactoryTest extends \MediaWikiUnitTestCase { $wrapper = TestingAccessWrapper::newFromObject( $store ); $this->assertEquals( $wikiId, $wrapper->wikiId ); } + } diff --git a/tests/phpunit/unit/includes/Storage/PreparedEditTest.php b/tests/phpunit/includes/Storage/PreparedEditTest.php index e3249e74bc2c..29999ee535e0 100644 --- a/tests/phpunit/unit/includes/Storage/PreparedEditTest.php +++ b/tests/phpunit/includes/Storage/PreparedEditTest.php @@ -3,11 +3,12 @@ namespace MediaWiki\Edit; use ParserOutput; +use MediaWikiTestCase; /** * @covers \MediaWiki\Edit\PreparedEdit */ -class PreparedEditTest extends \MediaWikiUnitTestCase { +class PreparedEditTest extends MediaWikiTestCase { function testCallback() { $output = new ParserOutput(); $edit = new PreparedEdit(); diff --git a/tests/phpunit/unit/includes/TitleArrayFromResultTest.php b/tests/phpunit/includes/TitleArrayFromResultTest.php index 32c757101aa9..32c757101aa9 100644 --- a/tests/phpunit/unit/includes/TitleArrayFromResultTest.php +++ b/tests/phpunit/includes/TitleArrayFromResultTest.php diff --git a/tests/phpunit/unit/includes/WikiReferenceTest.php b/tests/phpunit/includes/WikiReferenceTest.php index e4b21ce5ac96..e4b21ce5ac96 100644 --- a/tests/phpunit/unit/includes/WikiReferenceTest.php +++ b/tests/phpunit/includes/WikiReferenceTest.php diff --git a/tests/phpunit/unit/includes/XmlJsTest.php b/tests/phpunit/includes/XmlJsTest.php index c7975efabc91..c7975efabc91 100644 --- a/tests/phpunit/unit/includes/XmlJsTest.php +++ b/tests/phpunit/includes/XmlJsTest.php diff --git a/tests/phpunit/unit/includes/XmlSelectTest.php b/tests/phpunit/includes/XmlSelectTest.php index 54d269e0ceed..52e20bdb99d1 100644 --- a/tests/phpunit/unit/includes/XmlSelectTest.php +++ b/tests/phpunit/includes/XmlSelectTest.php @@ -3,7 +3,7 @@ /** * @group Xml */ -class XmlSelectTest extends \MediaWikiUnitTestCase { +class XmlSelectTest extends MediaWikiTestCase { /** * @var XmlSelect diff --git a/tests/phpunit/unit/includes/actions/ViewActionTest.php b/tests/phpunit/includes/actions/ViewActionTest.php index 99d61b6e4b48..5f659c07a21e 100644 --- a/tests/phpunit/unit/includes/actions/ViewActionTest.php +++ b/tests/phpunit/includes/actions/ViewActionTest.php @@ -7,7 +7,7 @@ * * @author Derick N. Alangi */ -class ViewActionTest extends \MediaWikiUnitTestCase { +class ViewActionTest extends MediaWikiTestCase { /** * @return ViewAction */ diff --git a/tests/phpunit/includes/api/ApiBlockInfoTraitTest.php b/tests/phpunit/includes/api/ApiBlockInfoTraitTest.php new file mode 100644 index 000000000000..ba5c00377661 --- /dev/null +++ b/tests/phpunit/includes/api/ApiBlockInfoTraitTest.php @@ -0,0 +1,43 @@ +<?php + +use Wikimedia\TestingAccessWrapper; +use MediaWiki\Block\DatabaseBlock; +use MediaWiki\Block\SystemBlock; + +/** + * @covers ApiBlockInfoTrait + */ +class ApiBlockInfoTraitTest extends MediaWikiTestCase { + /** + * @dataProvider provideGetBlockDetails + */ + public function testGetBlockDetails( $block, $expectedInfo ) { + $mock = $this->getMockForTrait( ApiBlockInfoTrait::class ); + $info = TestingAccessWrapper::newFromObject( $mock )->getBlockDetails( $block ); + $subset = array_merge( [ + 'blockid' => null, + 'blockedby' => '', + 'blockedbyid' => 0, + 'blockreason' => '', + 'blockexpiry' => 'infinite', + ], $expectedInfo ); + $this->assertArraySubset( $subset, $info ); + } + + public static function provideGetBlockDetails() { + return [ + 'Sitewide block' => [ + new DatabaseBlock(), + [ 'blockpartial' => false ], + ], + 'Partial block' => [ + new DatabaseBlock( [ 'sitewide' => false ] ), + [ 'blockpartial' => true ], + ], + 'System block' => [ + new SystemBlock( [ 'systemBlock' => 'proxy' ] ), + [ 'systemblocktype' => 'proxy' ] + ], + ]; + } +} diff --git a/tests/phpunit/unit/includes/api/ApiContinuationManagerTest.php b/tests/phpunit/includes/api/ApiContinuationManagerTest.php index cc1351b12ad4..788d120c6b7b 100644 --- a/tests/phpunit/unit/includes/api/ApiContinuationManagerTest.php +++ b/tests/phpunit/includes/api/ApiContinuationManagerTest.php @@ -4,7 +4,7 @@ * @covers ApiContinuationManager * @group API */ -class ApiContinuationManagerTest extends \MediaWikiUnitTestCase { +class ApiContinuationManagerTest extends MediaWikiTestCase { private static function getManager( $continue, $allModules, $generatedModules ) { $context = new DerivativeContext( RequestContext::getMain() ); diff --git a/tests/phpunit/unit/includes/api/ApiMessageTest.php b/tests/phpunit/includes/api/ApiMessageTest.php index d6fa7809d0ce..70114c2593b6 100644 --- a/tests/phpunit/unit/includes/api/ApiMessageTest.php +++ b/tests/phpunit/includes/api/ApiMessageTest.php @@ -5,7 +5,7 @@ use Wikimedia\TestingAccessWrapper; /** * @group API */ -class ApiMessageTest extends \MediaWikiUnitTestCase { +class ApiMessageTest extends MediaWikiTestCase { private function compareMessages( Message $msg, Message $msg2 ) { $this->assertSame( $msg->getKey(), $msg2->getKey(), 'getKey' ); diff --git a/tests/phpunit/unit/includes/api/ApiResultTest.php b/tests/phpunit/includes/api/ApiResultTest.php index 2d99890d50e3..98e24fb66628 100644 --- a/tests/phpunit/unit/includes/api/ApiResultTest.php +++ b/tests/phpunit/includes/api/ApiResultTest.php @@ -4,7 +4,7 @@ * @covers ApiResult * @group API */ -class ApiResultTest extends \MediaWikiUnitTestCase { +class ApiResultTest extends MediaWikiTestCase { /** * @covers ApiResult diff --git a/tests/phpunit/unit/includes/api/ApiUsageExceptionTest.php b/tests/phpunit/includes/api/ApiUsageExceptionTest.php index 51260a67f9ca..bb7202112134 100644 --- a/tests/phpunit/unit/includes/api/ApiUsageExceptionTest.php +++ b/tests/phpunit/includes/api/ApiUsageExceptionTest.php @@ -3,7 +3,7 @@ /** * @covers ApiUsageException */ -class ApiUsageExceptionTest extends \MediaWikiUnitTestCase { +class ApiUsageExceptionTest extends MediaWikiTestCase { public function testCreateWithStatusValue_CanGetAMessageObject() { $messageKey = 'some-message-key'; diff --git a/tests/phpunit/unit/includes/auth/AbstractPreAuthenticationProviderTest.php b/tests/phpunit/includes/auth/AbstractPreAuthenticationProviderTest.php index 8ec3380069eb..2970a2807c7e 100644 --- a/tests/phpunit/unit/includes/auth/AbstractPreAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/AbstractPreAuthenticationProviderTest.php @@ -6,7 +6,7 @@ namespace MediaWiki\Auth; * @group AuthManager * @covers \MediaWiki\Auth\AbstractPreAuthenticationProvider */ -class AbstractPreAuthenticationProviderTest extends \MediaWikiUnitTestCase { +class AbstractPreAuthenticationProviderTest extends \MediaWikiTestCase { public function testAbstractPreAuthenticationProvider() { $user = \User::newFromName( 'UTSysop' ); diff --git a/tests/phpunit/unit/includes/auth/AbstractSecondaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/AbstractSecondaryAuthenticationProviderTest.php index e933cb8c67b3..cd17862838f1 100644 --- a/tests/phpunit/unit/includes/auth/AbstractSecondaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/AbstractSecondaryAuthenticationProviderTest.php @@ -6,7 +6,7 @@ namespace MediaWiki\Auth; * @group AuthManager * @covers \MediaWiki\Auth\AbstractSecondaryAuthenticationProvider */ -class AbstractSecondaryAuthenticationProviderTest extends \MediaWikiUnitTestCase { +class AbstractSecondaryAuthenticationProviderTest extends \MediaWikiTestCase { public function testAbstractSecondaryAuthenticationProvider() { $user = \User::newFromName( 'UTSysop' ); diff --git a/tests/phpunit/unit/includes/auth/AuthenticationResponseTest.php b/tests/phpunit/includes/auth/AuthenticationResponseTest.php index 44b063153bfe..c79682275f9d 100644 --- a/tests/phpunit/unit/includes/auth/AuthenticationResponseTest.php +++ b/tests/phpunit/includes/auth/AuthenticationResponseTest.php @@ -6,7 +6,7 @@ namespace MediaWiki\Auth; * @group AuthManager * @covers \MediaWiki\Auth\AuthenticationResponse */ -class AuthenticationResponseTest extends \MediaWikiUnitTestCase { +class AuthenticationResponseTest extends \MediaWikiTestCase { /** * @dataProvider provideConstructors * @param string $constructor diff --git a/tests/phpunit/unit/includes/auth/ConfirmLinkSecondaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/ConfirmLinkSecondaryAuthenticationProviderTest.php index 7a4490bb675c..b17da2e2cfba 100644 --- a/tests/phpunit/unit/includes/auth/ConfirmLinkSecondaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/ConfirmLinkSecondaryAuthenticationProviderTest.php @@ -8,7 +8,7 @@ use Wikimedia\TestingAccessWrapper; * @group AuthManager * @covers \MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider */ -class ConfirmLinkSecondaryAuthenticationProviderTest extends \MediaWikiUnitTestCase { +class ConfirmLinkSecondaryAuthenticationProviderTest extends \MediaWikiTestCase { /** * @dataProvider provideGetAuthenticationRequests * @param string $action diff --git a/tests/phpunit/unit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php index fcaf6bf1a388..ff22def7f817 100644 --- a/tests/phpunit/unit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php @@ -3,39 +3,12 @@ namespace MediaWiki\Auth; use Psr\Log\LoggerInterface; -use Wikimedia\Rdbms\IDatabase; -use Wikimedia\Rdbms\LoadBalancer; use Wikimedia\TestingAccessWrapper; /** * @covers \MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider */ -class EmailNotificationSecondaryAuthenticationProviderTest extends \MediaWikiUnitTestCase { - - protected function setUp() { - parent::setUp(); - - $lbMock = $this->createMock( LoadBalancer::class ); - $dbMock = $this->getMockBuilder( IDatabase::class ) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $lbMock->expects( $this->any() ) - ->method( 'getConnection' ) - ->willReturn( $dbMock ); - $dbMock->expects( $this->any() ) - ->method( 'onTransactionCommitOrIdle' ) - ->willReturnCallback( function ( callable $callback ) { - $callback(); - } ); - - $lbMockFactory = function () use ( $lbMock ): LoadBalancer { - return $lbMock; - }; - - $this->overrideMwServices( [ 'DBLoadBalancer' => $lbMockFactory ] ); - } - +class EmailNotificationSecondaryAuthenticationProviderTest extends \PHPUnit\Framework\TestCase { public function testConstructor() { $config = new \HashConfig( [ 'EnableEmail' => true, diff --git a/tests/phpunit/unit/includes/changes/ChangesListFilterGroupTest.php b/tests/phpunit/includes/changes/ChangesListFilterGroupTest.php index bd54d508ba7e..6190516e6844 100644 --- a/tests/phpunit/unit/includes/changes/ChangesListFilterGroupTest.php +++ b/tests/phpunit/includes/changes/ChangesListFilterGroupTest.php @@ -3,7 +3,7 @@ /** * @covers ChangesListFilterGroup */ -class ChangesListFilterGroupTest extends \MediaWikiUnitTestCase { +class ChangesListFilterGroupTest extends MediaWikiTestCase { /** * phpcs:disable Generic.Files.LineLength * @expectedException MWException diff --git a/tests/phpunit/unit/includes/collation/CustomUppercaseCollationTest.php b/tests/phpunit/includes/collation/CustomUppercaseCollationTest.php index 0dfe59cb9969..417b468b1d4c 100644 --- a/tests/phpunit/unit/includes/collation/CustomUppercaseCollationTest.php +++ b/tests/phpunit/includes/collation/CustomUppercaseCollationTest.php @@ -3,7 +3,7 @@ /** * @covers CustomUppercaseCollation */ -class CustomUppercaseCollationTest extends \MediaWikiUnitTestCase { +class CustomUppercaseCollationTest extends MediaWikiTestCase { public function setUp() { $this->collation = new CustomUppercaseCollation( [ diff --git a/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php b/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php index c5c0dc7d6b8f..c5c0dc7d6b8f 100644 --- a/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php +++ b/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php diff --git a/tests/phpunit/unit/includes/config/ConfigFactoryTest.php b/tests/phpunit/includes/config/ConfigFactoryTest.php index a136018c9649..ea747afac14f 100644 --- a/tests/phpunit/unit/includes/config/ConfigFactoryTest.php +++ b/tests/phpunit/includes/config/ConfigFactoryTest.php @@ -2,7 +2,7 @@ use MediaWiki\MediaWikiServices; -class ConfigFactoryTest extends \MediaWikiUnitTestCase { +class ConfigFactoryTest extends MediaWikiTestCase { /** * @covers ConfigFactory::register diff --git a/tests/phpunit/unit/includes/config/EtcdConfigTest.php b/tests/phpunit/includes/config/EtcdConfigTest.php index 3eecf82704d4..3eecf82704d4 100644 --- a/tests/phpunit/unit/includes/config/EtcdConfigTest.php +++ b/tests/phpunit/includes/config/EtcdConfigTest.php diff --git a/tests/phpunit/unit/includes/config/HashConfigTest.php b/tests/phpunit/includes/config/HashConfigTest.php index d46ee09d5bf9..bac8311cd45b 100644 --- a/tests/phpunit/unit/includes/config/HashConfigTest.php +++ b/tests/phpunit/includes/config/HashConfigTest.php @@ -1,6 +1,6 @@ <?php -class HashConfigTest extends \MediaWikiUnitTestCase { +class HashConfigTest extends MediaWikiTestCase { /** * @covers HashConfig::newInstance diff --git a/tests/phpunit/unit/includes/config/MultiConfigTest.php b/tests/phpunit/includes/config/MultiConfigTest.php index 435115130294..fc2839513b18 100644 --- a/tests/phpunit/unit/includes/config/MultiConfigTest.php +++ b/tests/phpunit/includes/config/MultiConfigTest.php @@ -1,6 +1,6 @@ <?php -class MultiConfigTest extends \MediaWikiUnitTestCase { +class MultiConfigTest extends MediaWikiTestCase { /** * Tests that settings are fetched in the right order diff --git a/tests/phpunit/unit/includes/config/ServiceOptionsTest.php b/tests/phpunit/includes/config/ServiceOptionsTest.php index c58c6f579c37..966cf411c764 100644 --- a/tests/phpunit/unit/includes/config/ServiceOptionsTest.php +++ b/tests/phpunit/includes/config/ServiceOptionsTest.php @@ -5,7 +5,7 @@ use MediaWiki\Config\ServiceOptions; /** * @coversDefaultClass \MediaWiki\Config\ServiceOptions */ -class ServiceOptionsTest extends \MediaWikiUnitTestCase { +class ServiceOptionsTest extends MediaWikiTestCase { public static $testObj; public static function setUpBeforeClass() { diff --git a/tests/phpunit/unit/includes/content/JsonContentHandlerTest.php b/tests/phpunit/includes/content/JsonContentHandlerTest.php index 70db73c810b5..abfb6733a585 100644 --- a/tests/phpunit/unit/includes/content/JsonContentHandlerTest.php +++ b/tests/phpunit/includes/content/JsonContentHandlerTest.php @@ -1,6 +1,6 @@ <?php -class JsonContentHandlerTest extends \MediaWikiUnitTestCase { +class JsonContentHandlerTest extends MediaWikiTestCase { /** * @covers JsonContentHandler::makeEmptyContent diff --git a/tests/phpunit/unit/includes/db/DatabaseOracleTest.php b/tests/phpunit/includes/db/DatabaseOracleTest.php index 061e121a244e..061e121a244e 100644 --- a/tests/phpunit/unit/includes/db/DatabaseOracleTest.php +++ b/tests/phpunit/includes/db/DatabaseOracleTest.php diff --git a/tests/phpunit/unit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php index d29f44d025a3..6f0b1db9f256 100644 --- a/tests/phpunit/unit/includes/debug/MWDebugTest.php +++ b/tests/phpunit/includes/debug/MWDebugTest.php @@ -1,6 +1,6 @@ <?php -class MWDebugTest extends \MediaWikiUnitTestCase { +class MWDebugTest extends MediaWikiTestCase { protected function setUp() { parent::setUp(); diff --git a/tests/phpunit/unit/includes/debug/logger/MonologSpiTest.php b/tests/phpunit/includes/debug/logger/MonologSpiTest.php index ecb5d17c2a72..fda3ac614adb 100644 --- a/tests/phpunit/unit/includes/debug/logger/MonologSpiTest.php +++ b/tests/phpunit/includes/debug/logger/MonologSpiTest.php @@ -20,9 +20,10 @@ namespace MediaWiki\Logger; +use MediaWikiTestCase; use Wikimedia\TestingAccessWrapper; -class MonologSpiTest extends \MediaWikiUnitTestCase { +class MonologSpiTest extends MediaWikiTestCase { /** * @covers MediaWiki\Logger\MonologSpi::mergeConfig diff --git a/tests/phpunit/unit/includes/debug/logger/monolog/AvroFormatterTest.php b/tests/phpunit/includes/debug/logger/monolog/AvroFormatterTest.php index e09156192378..baa4df7390ad 100644 --- a/tests/phpunit/unit/includes/debug/logger/monolog/AvroFormatterTest.php +++ b/tests/phpunit/includes/debug/logger/monolog/AvroFormatterTest.php @@ -20,12 +20,13 @@ namespace MediaWiki\Logger\Monolog; +use MediaWikiTestCase; use PHPUnit_Framework_Error_Notice; /** * @covers \MediaWiki\Logger\Monolog\AvroFormatter */ -class AvroFormatterTest extends \MediaWikiUnitTestCase { +class AvroFormatterTest extends MediaWikiTestCase { protected function setUp() { if ( !class_exists( 'AvroStringIO' ) ) { diff --git a/tests/phpunit/unit/includes/debug/logger/monolog/CeeFormatterTest.php b/tests/phpunit/includes/debug/logger/monolog/CeeFormatterTest.php index b30c7a4c9250..b30c7a4c9250 100644 --- a/tests/phpunit/unit/includes/debug/logger/monolog/CeeFormatterTest.php +++ b/tests/phpunit/includes/debug/logger/monolog/CeeFormatterTest.php diff --git a/tests/phpunit/unit/includes/debug/logger/monolog/KafkaHandlerTest.php b/tests/phpunit/includes/debug/logger/monolog/KafkaHandlerTest.php index bbac17f1ccb0..4c0ca04fef3c 100644 --- a/tests/phpunit/unit/includes/debug/logger/monolog/KafkaHandlerTest.php +++ b/tests/phpunit/includes/debug/logger/monolog/KafkaHandlerTest.php @@ -20,13 +20,14 @@ namespace MediaWiki\Logger\Monolog; +use MediaWikiTestCase; use Monolog\Logger; use Wikimedia\TestingAccessWrapper; /** * @covers \MediaWiki\Logger\Monolog\KafkaHandler */ -class KafkaHandlerTest extends \MediaWikiUnitTestCase { +class KafkaHandlerTest extends MediaWikiTestCase { protected function setUp() { if ( !class_exists( 'Monolog\Handler\AbstractProcessingHandler' ) diff --git a/tests/phpunit/unit/includes/debug/logger/monolog/LineFormatterTest.php b/tests/phpunit/includes/debug/logger/monolog/LineFormatterTest.php index 8da3d9304ea3..bdd5c8111851 100644 --- a/tests/phpunit/unit/includes/debug/logger/monolog/LineFormatterTest.php +++ b/tests/phpunit/includes/debug/logger/monolog/LineFormatterTest.php @@ -24,9 +24,10 @@ use AssertionError; use InvalidArgumentException; use LengthException; use LogicException; +use MediaWikiTestCase; use Wikimedia\TestingAccessWrapper; -class LineFormatterTest extends \MediaWikiUnitTestCase { +class LineFormatterTest extends MediaWikiTestCase { protected function setUp() { if ( !class_exists( 'Monolog\Formatter\LineFormatter' ) ) { diff --git a/tests/phpunit/unit/includes/debug/logger/monolog/LogstashFormatterTest.php b/tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php index a1207b26b2ec..a1207b26b2ec 100644 --- a/tests/phpunit/unit/includes/debug/logger/monolog/LogstashFormatterTest.php +++ b/tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php diff --git a/tests/phpunit/unit/includes/deferred/MWCallableUpdateTest.php b/tests/phpunit/includes/deferred/MWCallableUpdateTest.php index 3ab9b5659ed5..3ab9b5659ed5 100644 --- a/tests/phpunit/unit/includes/deferred/MWCallableUpdateTest.php +++ b/tests/phpunit/includes/deferred/MWCallableUpdateTest.php diff --git a/tests/phpunit/unit/includes/deferred/TransactionRoundDefiningUpdateTest.php b/tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php index 693897e676d5..693897e676d5 100644 --- a/tests/phpunit/unit/includes/deferred/TransactionRoundDefiningUpdateTest.php +++ b/tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php diff --git a/tests/phpunit/unit/includes/diff/ArrayDiffFormatterTest.php b/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php index d436991fe9a9..8d94404cd4f6 100644 --- a/tests/phpunit/unit/includes/diff/ArrayDiffFormatterTest.php +++ b/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php @@ -5,7 +5,7 @@ * * @group Diff */ -class ArrayDiffFormatterTest extends \MediaWikiUnitTestCase { +class ArrayDiffFormatterTest extends MediaWikiTestCase { /** * @param Diff $input diff --git a/tests/phpunit/unit/includes/diff/DiffOpTest.php b/tests/phpunit/includes/diff/DiffOpTest.php index 4e1aced7a6d4..3026fad6bd66 100644 --- a/tests/phpunit/unit/includes/diff/DiffOpTest.php +++ b/tests/phpunit/includes/diff/DiffOpTest.php @@ -4,7 +4,7 @@ * * @group Diff */ -class DiffOpTest extends \MediaWikiUnitTestCase { +class DiffOpTest extends MediaWikiTestCase { /** * @covers DiffOp::getType diff --git a/tests/phpunit/unit/includes/diff/DiffTest.php b/tests/phpunit/includes/diff/DiffTest.php index f0a8490f72ff..da6d7d95446e 100644 --- a/tests/phpunit/unit/includes/diff/DiffTest.php +++ b/tests/phpunit/includes/diff/DiffTest.php @@ -5,7 +5,7 @@ * * @group Diff */ -class DiffTest extends \MediaWikiUnitTestCase { +class DiffTest extends MediaWikiTestCase { /** * @covers Diff::getEdits diff --git a/tests/phpunit/unit/includes/diff/DifferenceEngineSlotDiffRendererTest.php b/tests/phpunit/includes/diff/DifferenceEngineSlotDiffRendererTest.php index fe129b751aec..fe129b751aec 100644 --- a/tests/phpunit/unit/includes/diff/DifferenceEngineSlotDiffRendererTest.php +++ b/tests/phpunit/includes/diff/DifferenceEngineSlotDiffRendererTest.php diff --git a/tests/phpunit/unit/includes/diff/SlotDiffRendererTest.php b/tests/phpunit/includes/diff/SlotDiffRendererTest.php index a03280ddb285..a03280ddb285 100644 --- a/tests/phpunit/unit/includes/diff/SlotDiffRendererTest.php +++ b/tests/phpunit/includes/diff/SlotDiffRendererTest.php diff --git a/tests/phpunit/unit/includes/exception/HttpErrorTest.php b/tests/phpunit/includes/exception/HttpErrorTest.php index c0f310a993a8..90ccd1e551d0 100644 --- a/tests/phpunit/unit/includes/exception/HttpErrorTest.php +++ b/tests/phpunit/includes/exception/HttpErrorTest.php @@ -5,7 +5,7 @@ * * @covers HttpError */ -class HttpErrorTest extends \MediaWikiUnitTestCase { +class HttpErrorTest extends MediaWikiTestCase { public function testIsLoggable() { $httpError = new HttpError( 500, 'server error!' ); diff --git a/tests/phpunit/unit/includes/exception/MWExceptionHandlerTest.php b/tests/phpunit/includes/exception/MWExceptionHandlerTest.php index 2b021c4f7772..6606065660ee 100644 --- a/tests/phpunit/unit/includes/exception/MWExceptionHandlerTest.php +++ b/tests/phpunit/includes/exception/MWExceptionHandlerTest.php @@ -6,7 +6,7 @@ * @file */ -class MWExceptionHandlerTest extends \MediaWikiUnitTestCase { +class MWExceptionHandlerTest extends MediaWikiTestCase { /** * @covers MWExceptionHandler::getRedactedTrace diff --git a/tests/phpunit/includes/exception/ReadOnlyErrorTest.php b/tests/phpunit/includes/exception/ReadOnlyErrorTest.php new file mode 100644 index 000000000000..ee5becffc6f0 --- /dev/null +++ b/tests/phpunit/includes/exception/ReadOnlyErrorTest.php @@ -0,0 +1,16 @@ +<?php + +/** + * @covers ReadOnlyError + * @author Addshore + */ +class ReadOnlyErrorTest extends MediaWikiTestCase { + + public function testConstruction() { + $e = new ReadOnlyError(); + $this->assertEquals( 'readonly', $e->title ); + $this->assertEquals( 'readonlytext', $e->msg ); + $this->assertEquals( wfReadOnlyReason() ?: [], $e->params ); + } + +} diff --git a/tests/phpunit/unit/includes/exception/UserNotLoggedInTest.php b/tests/phpunit/includes/exception/UserNotLoggedInTest.php index 3888c8e15c63..55ec45a020b4 100644 --- a/tests/phpunit/unit/includes/exception/UserNotLoggedInTest.php +++ b/tests/phpunit/includes/exception/UserNotLoggedInTest.php @@ -4,7 +4,7 @@ * @covers UserNotLoggedIn * @author Addshore */ -class UserNotLoggedInTest extends \MediaWikiUnitTestCase { +class UserNotLoggedInTest extends MediaWikiTestCase { public function testConstruction() { $e = new UserNotLoggedIn(); diff --git a/tests/phpunit/unit/includes/externalstore/ExternalStoreFactoryTest.php b/tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php index f7626938640e..f7626938640e 100644 --- a/tests/phpunit/unit/includes/externalstore/ExternalStoreFactoryTest.php +++ b/tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php diff --git a/tests/phpunit/unit/includes/filebackend/SwiftFileBackendTest.php b/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php index fbc1a571c581..35eca28f7e00 100644 --- a/tests/phpunit/unit/includes/filebackend/SwiftFileBackendTest.php +++ b/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php @@ -12,7 +12,7 @@ use Wikimedia\TestingAccessWrapper; * @covers SwiftFileBackendFileList * @covers SwiftFileBackendList */ -class SwiftFileBackendTest extends \MediaWikiUnitTestCase { +class SwiftFileBackendTest extends MediaWikiTestCase { /** @var TestingAccessWrapper Proxy to SwiftFileBackend */ private $backend; diff --git a/tests/phpunit/unit/includes/filerepo/FileBackendDBRepoWrapperTest.php b/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php index 4db9892f9d63..346be7afa39a 100644 --- a/tests/phpunit/unit/includes/filerepo/FileBackendDBRepoWrapperTest.php +++ b/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php @@ -1,6 +1,6 @@ <?php -class FileBackendDBRepoWrapperTest extends \MediaWikiUnitTestCase { +class FileBackendDBRepoWrapperTest extends MediaWikiTestCase { protected $backendName = 'foo-backend'; protected $repoName = 'pureTestRepo'; diff --git a/tests/phpunit/unit/includes/filerepo/FileRepoTest.php b/tests/phpunit/includes/filerepo/FileRepoTest.php index 90cd5ecd0cb9..0d3e679aa8ad 100644 --- a/tests/phpunit/unit/includes/filerepo/FileRepoTest.php +++ b/tests/phpunit/includes/filerepo/FileRepoTest.php @@ -1,6 +1,6 @@ <?php -class FileRepoTest extends \MediaWikiUnitTestCase { +class FileRepoTest extends MediaWikiTestCase { /** * @expectedException MWException diff --git a/tests/phpunit/unit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php b/tests/phpunit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php index 64f8a00bc60d..eaba22d7fb61 100644 --- a/tests/phpunit/unit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php +++ b/tests/phpunit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php @@ -2,7 +2,7 @@ /** * @covers HTMLAutoCompleteSelectField */ -class HTMLAutoCompleteSelectFieldTest extends \MediaWikiUnitTestCase { +class HTMLAutoCompleteSelectFieldTest extends MediaWikiTestCase { public $options = [ 'Bulgaria' => 'BGR', diff --git a/tests/phpunit/unit/includes/htmlform/HTMLCheckMatrixTest.php b/tests/phpunit/includes/htmlform/HTMLCheckMatrixTest.php index 9c41ab8275c9..05c567df75a5 100644 --- a/tests/phpunit/unit/includes/htmlform/HTMLCheckMatrixTest.php +++ b/tests/phpunit/includes/htmlform/HTMLCheckMatrixTest.php @@ -3,7 +3,7 @@ /** * @covers HTMLCheckMatrix */ -class HTMLCheckMatrixTest extends \MediaWikiUnitTestCase { +class HTMLCheckMatrixTest extends MediaWikiTestCase { private static $defaultOptions = [ 'rows' => [ 'r1', 'r2' ], 'columns' => [ 'c1', 'c2' ], diff --git a/tests/phpunit/unit/includes/htmlform/HTMLFormTest.php b/tests/phpunit/includes/htmlform/HTMLFormTest.php index d9d2cb1191ee..d7dc4112b789 100644 --- a/tests/phpunit/unit/includes/htmlform/HTMLFormTest.php +++ b/tests/phpunit/includes/htmlform/HTMLFormTest.php @@ -6,7 +6,7 @@ * @license GPL-2.0-or-later * @author Gergő Tisza */ -class HTMLFormTest extends \MediaWikiUnitTestCase { +class HTMLFormTest extends MediaWikiTestCase { private function newInstance() { $form = new HTMLForm( [] ); diff --git a/tests/phpunit/unit/includes/htmlform/HTMLRestrictionsFieldTest.php b/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php index c4290e1e64b5..c4290e1e64b5 100644 --- a/tests/phpunit/unit/includes/htmlform/HTMLRestrictionsFieldTest.php +++ b/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php diff --git a/tests/phpunit/unit/includes/http/GuzzleHttpRequestTest.php b/tests/phpunit/includes/http/GuzzleHttpRequestTest.php index e271ac6e0071..c9356b6b1017 100644 --- a/tests/phpunit/unit/includes/http/GuzzleHttpRequestTest.php +++ b/tests/phpunit/includes/http/GuzzleHttpRequestTest.php @@ -13,7 +13,7 @@ use GuzzleHttp\Psr7\Request; * @covers GuzzleHttpRequest * @covers MWHttpRequest */ -class GuzzleHttpRequestTest extends \MediaWikiUnitTestCase { +class GuzzleHttpRequestTest extends MediaWikiTestCase { /** * Placeholder url to use for various tests. This is never contacted, but we must use * a url of valid format to avoid validation errors. diff --git a/tests/phpunit/unit/includes/http/HttpRequestFactoryTest.php b/tests/phpunit/includes/http/HttpRequestFactoryTest.php index 61c67fde57b9..7429dcc9ddf5 100644 --- a/tests/phpunit/unit/includes/http/HttpRequestFactoryTest.php +++ b/tests/phpunit/includes/http/HttpRequestFactoryTest.php @@ -5,7 +5,7 @@ use MediaWiki\Http\HttpRequestFactory; /** * @covers MediaWiki\Http\HttpRequestFactory */ -class HttpRequestFactoryTest extends \MediaWikiUnitTestCase { +class HttpRequestFactoryTest extends MediaWikiTestCase { /** * @return HttpRequestFactory diff --git a/tests/phpunit/unit/includes/installer/InstallDocFormatterTest.php b/tests/phpunit/includes/installer/InstallDocFormatterTest.php index fddc3b8680c3..9584d4b8c451 100644 --- a/tests/phpunit/unit/includes/installer/InstallDocFormatterTest.php +++ b/tests/phpunit/includes/installer/InstallDocFormatterTest.php @@ -1,6 +1,6 @@ <?php -class InstallDocFormatterTest extends \MediaWikiUnitTestCase { +class InstallDocFormatterTest extends MediaWikiTestCase { /** * @covers InstallDocFormatter * @dataProvider provideDocFormattingTests diff --git a/tests/phpunit/unit/includes/installer/OracleInstallerTest.php b/tests/phpunit/includes/installer/OracleInstallerTest.php index 7dbb2186cbc0..e255089de4fb 100644 --- a/tests/phpunit/unit/includes/installer/OracleInstallerTest.php +++ b/tests/phpunit/includes/installer/OracleInstallerTest.php @@ -4,7 +4,7 @@ * @group Database * @group Installer */ -class OracleInstallerTest extends \MediaWikiUnitTestCase { +class OracleInstallerTest extends MediaWikiTestCase { /** * @dataProvider provideOracleConnectStrings diff --git a/tests/phpunit/unit/includes/interwiki/InterwikiLookupAdapterTest.php b/tests/phpunit/includes/interwiki/InterwikiLookupAdapterTest.php index abbd2d778eb4..0a13de1d9679 100644 --- a/tests/phpunit/unit/includes/interwiki/InterwikiLookupAdapterTest.php +++ b/tests/phpunit/includes/interwiki/InterwikiLookupAdapterTest.php @@ -8,7 +8,7 @@ use MediaWiki\Interwiki\InterwikiLookupAdapter; * @group MediaWiki * @group Interwiki */ -class InterwikiLookupAdapterTest extends \MediaWikiUnitTestCase { +class InterwikiLookupAdapterTest extends MediaWikiTestCase { /** * @var InterwikiLookupAdapter diff --git a/tests/phpunit/unit/includes/jobqueue/JobQueueMemoryTest.php b/tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php index 232b46a31ba3..232b46a31ba3 100644 --- a/tests/phpunit/unit/includes/jobqueue/JobQueueMemoryTest.php +++ b/tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php diff --git a/tests/phpunit/unit/includes/json/FormatJsonTest.php b/tests/phpunit/includes/json/FormatJsonTest.php index f07eea780d90..a6adf343d5af 100644 --- a/tests/phpunit/unit/includes/json/FormatJsonTest.php +++ b/tests/phpunit/includes/json/FormatJsonTest.php @@ -3,7 +3,7 @@ /** * @covers FormatJson */ -class FormatJsonTest extends \MediaWikiUnitTestCase { +class FormatJsonTest extends MediaWikiTestCase { public static function provideEncoderPrettyPrinting() { return [ diff --git a/tests/phpunit/unit/includes/libs/ArrayUtilsTest.php b/tests/phpunit/includes/libs/ArrayUtilsTest.php index 12b632056475..12b632056475 100644 --- a/tests/phpunit/unit/includes/libs/ArrayUtilsTest.php +++ b/tests/phpunit/includes/libs/ArrayUtilsTest.php diff --git a/tests/phpunit/unit/includes/libs/CookieTest.php b/tests/phpunit/includes/libs/CookieTest.php index e383be965069..e383be965069 100644 --- a/tests/phpunit/unit/includes/libs/CookieTest.php +++ b/tests/phpunit/includes/libs/CookieTest.php diff --git a/tests/phpunit/unit/includes/libs/DeferredStringifierTest.php b/tests/phpunit/includes/libs/DeferredStringifierTest.php index c9cdf5831ded..c9cdf5831ded 100644 --- a/tests/phpunit/unit/includes/libs/DeferredStringifierTest.php +++ b/tests/phpunit/includes/libs/DeferredStringifierTest.php diff --git a/tests/phpunit/unit/includes/libs/DnsSrvDiscovererTest.php b/tests/phpunit/includes/libs/DnsSrvDiscovererTest.php index 1b3397c12ab0..1b3397c12ab0 100644 --- a/tests/phpunit/unit/includes/libs/DnsSrvDiscovererTest.php +++ b/tests/phpunit/includes/libs/DnsSrvDiscovererTest.php diff --git a/tests/phpunit/unit/includes/libs/EasyDeflateTest.php b/tests/phpunit/includes/libs/EasyDeflateTest.php index da39d48d901a..da39d48d901a 100644 --- a/tests/phpunit/unit/includes/libs/EasyDeflateTest.php +++ b/tests/phpunit/includes/libs/EasyDeflateTest.php diff --git a/tests/phpunit/unit/includes/libs/GenericArrayObjectTest.php b/tests/phpunit/includes/libs/GenericArrayObjectTest.php index 3be2b06465dc..3be2b06465dc 100644 --- a/tests/phpunit/unit/includes/libs/GenericArrayObjectTest.php +++ b/tests/phpunit/includes/libs/GenericArrayObjectTest.php diff --git a/tests/phpunit/unit/includes/libs/HashRingTest.php b/tests/phpunit/includes/libs/HashRingTest.php index acaeb0255859..acaeb0255859 100644 --- a/tests/phpunit/unit/includes/libs/HashRingTest.php +++ b/tests/phpunit/includes/libs/HashRingTest.php diff --git a/tests/phpunit/unit/includes/libs/HtmlArmorTest.php b/tests/phpunit/includes/libs/HtmlArmorTest.php index c5e87e4e2aaa..c5e87e4e2aaa 100644 --- a/tests/phpunit/unit/includes/libs/HtmlArmorTest.php +++ b/tests/phpunit/includes/libs/HtmlArmorTest.php diff --git a/tests/phpunit/unit/includes/libs/IEUrlExtensionTest.php b/tests/phpunit/includes/libs/IEUrlExtensionTest.php index e04b2e21bf5d..e04b2e21bf5d 100644 --- a/tests/phpunit/unit/includes/libs/IEUrlExtensionTest.php +++ b/tests/phpunit/includes/libs/IEUrlExtensionTest.php diff --git a/tests/phpunit/unit/includes/libs/IPTest.php b/tests/phpunit/includes/libs/IPTest.php index 9ec53c00c773..9ec53c00c773 100644 --- a/tests/phpunit/unit/includes/libs/IPTest.php +++ b/tests/phpunit/includes/libs/IPTest.php diff --git a/tests/phpunit/unit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php index d57d0dd553cc..d57d0dd553cc 100644 --- a/tests/phpunit/unit/includes/libs/JavaScriptMinifierTest.php +++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php diff --git a/tests/phpunit/unit/includes/libs/MapCacheLRUTest.php b/tests/phpunit/includes/libs/MapCacheLRUTest.php index 7147c6fa224a..7147c6fa224a 100644 --- a/tests/phpunit/unit/includes/libs/MapCacheLRUTest.php +++ b/tests/phpunit/includes/libs/MapCacheLRUTest.php diff --git a/tests/phpunit/unit/includes/libs/MemoizedCallableTest.php b/tests/phpunit/includes/libs/MemoizedCallableTest.php index 628cca0c6877..628cca0c6877 100644 --- a/tests/phpunit/unit/includes/libs/MemoizedCallableTest.php +++ b/tests/phpunit/includes/libs/MemoizedCallableTest.php diff --git a/tests/phpunit/unit/includes/libs/ProcessCacheLRUTest.php b/tests/phpunit/includes/libs/ProcessCacheLRUTest.php index 8e91e70cb0cd..8e91e70cb0cd 100644 --- a/tests/phpunit/unit/includes/libs/ProcessCacheLRUTest.php +++ b/tests/phpunit/includes/libs/ProcessCacheLRUTest.php diff --git a/tests/phpunit/unit/includes/libs/SamplingStatsdClientTest.php b/tests/phpunit/includes/libs/SamplingStatsdClientTest.php index 7bd161156dcf..7bd161156dcf 100644 --- a/tests/phpunit/unit/includes/libs/SamplingStatsdClientTest.php +++ b/tests/phpunit/includes/libs/SamplingStatsdClientTest.php diff --git a/tests/phpunit/unit/includes/libs/StaticArrayWriterTest.php b/tests/phpunit/includes/libs/StaticArrayWriterTest.php index 4bd845d0b992..4bd845d0b992 100644 --- a/tests/phpunit/unit/includes/libs/StaticArrayWriterTest.php +++ b/tests/phpunit/includes/libs/StaticArrayWriterTest.php diff --git a/tests/phpunit/unit/includes/libs/StringUtilsTest.php b/tests/phpunit/includes/libs/StringUtilsTest.php index fcfa53e22df7..fcfa53e22df7 100644 --- a/tests/phpunit/unit/includes/libs/StringUtilsTest.php +++ b/tests/phpunit/includes/libs/StringUtilsTest.php diff --git a/tests/phpunit/unit/includes/libs/TimingTest.php b/tests/phpunit/includes/libs/TimingTest.php index 581a5186265f..581a5186265f 100644 --- a/tests/phpunit/unit/includes/libs/TimingTest.php +++ b/tests/phpunit/includes/libs/TimingTest.php diff --git a/tests/phpunit/unit/includes/libs/XhprofDataTest.php b/tests/phpunit/includes/libs/XhprofDataTest.php index 3e9379456d38..3e9379456d38 100644 --- a/tests/phpunit/unit/includes/libs/XhprofDataTest.php +++ b/tests/phpunit/includes/libs/XhprofDataTest.php diff --git a/tests/phpunit/unit/includes/libs/XhprofTest.php b/tests/phpunit/includes/libs/XhprofTest.php index ccad4a43d6b8..ccad4a43d6b8 100644 --- a/tests/phpunit/unit/includes/libs/XhprofTest.php +++ b/tests/phpunit/includes/libs/XhprofTest.php diff --git a/tests/phpunit/unit/includes/libs/XmlTypeCheckTest.php b/tests/phpunit/includes/libs/XmlTypeCheckTest.php index 8616b4192299..8616b4192299 100644 --- a/tests/phpunit/unit/includes/libs/XmlTypeCheckTest.php +++ b/tests/phpunit/includes/libs/XmlTypeCheckTest.php diff --git a/tests/phpunit/unit/includes/libs/composer/ComposerInstalledTest.php b/tests/phpunit/includes/libs/composer/ComposerInstalledTest.php index d94cc4570ed6..58e617ca82e6 100644 --- a/tests/phpunit/unit/includes/libs/composer/ComposerInstalledTest.php +++ b/tests/phpunit/includes/libs/composer/ComposerInstalledTest.php @@ -6,7 +6,7 @@ class ComposerInstalledTest extends PHPUnit\Framework\TestCase { public function setUp() { parent::setUp(); - $this->installed = __DIR__ . "/../../../../data/composer/installed.json"; + $this->installed = __DIR__ . "/../../../data/composer/installed.json"; } /** diff --git a/tests/phpunit/unit/includes/libs/composer/ComposerJsonTest.php b/tests/phpunit/includes/libs/composer/ComposerJsonTest.php index a009a51a9ed0..720fa6e8fd1a 100644 --- a/tests/phpunit/unit/includes/libs/composer/ComposerJsonTest.php +++ b/tests/phpunit/includes/libs/composer/ComposerJsonTest.php @@ -6,8 +6,8 @@ class ComposerJsonTest extends PHPUnit\Framework\TestCase { public function setUp() { parent::setUp(); - $this->json = __DIR__ . "/../../../../data/composer/composer.json"; - $this->json2 = __DIR__ . "/../../../../data/composer/new-composer.json"; + $this->json = __DIR__ . "/../../../data/composer/composer.json"; + $this->json2 = __DIR__ . "/../../../data/composer/new-composer.json"; } /** diff --git a/tests/phpunit/unit/includes/libs/composer/ComposerLockTest.php b/tests/phpunit/includes/libs/composer/ComposerLockTest.php index 90c036a472f8..f5fcdbe01819 100644 --- a/tests/phpunit/unit/includes/libs/composer/ComposerLockTest.php +++ b/tests/phpunit/includes/libs/composer/ComposerLockTest.php @@ -6,7 +6,7 @@ class ComposerLockTest extends PHPUnit\Framework\TestCase { public function setUp() { parent::setUp(); - $this->lock = __DIR__ . "/../../../../data/composer/composer.lock"; + $this->lock = __DIR__ . "/../../../data/composer/composer.lock"; } /** diff --git a/tests/phpunit/unit/includes/libs/http/HttpAcceptNegotiatorTest.php b/tests/phpunit/includes/libs/http/HttpAcceptNegotiatorTest.php index 02eac1188782..02eac1188782 100644 --- a/tests/phpunit/unit/includes/libs/http/HttpAcceptNegotiatorTest.php +++ b/tests/phpunit/includes/libs/http/HttpAcceptNegotiatorTest.php diff --git a/tests/phpunit/unit/includes/libs/http/HttpAcceptParserTest.php b/tests/phpunit/includes/libs/http/HttpAcceptParserTest.php index e4b47b46d57f..e4b47b46d57f 100644 --- a/tests/phpunit/unit/includes/libs/http/HttpAcceptParserTest.php +++ b/tests/phpunit/includes/libs/http/HttpAcceptParserTest.php diff --git a/tests/phpunit/unit/includes/libs/mime/MSCompoundFileReaderTest.php b/tests/phpunit/includes/libs/mime/MSCompoundFileReaderTest.php index 7cc0525660cb..4509a61eb708 100644 --- a/tests/phpunit/unit/includes/libs/mime/MSCompoundFileReaderTest.php +++ b/tests/phpunit/includes/libs/mime/MSCompoundFileReaderTest.php @@ -19,17 +19,6 @@ * @covers MSCompoundFileReader */ class MSCompoundFileReaderTest extends PHPUnit\Framework\TestCase { - - protected function setUp() { - parent::setUp(); - - if ( php_uname( 's' ) === 'Darwin' ) { - $this->markTestSkipped( - 'T225019: Disable this test on macOS for now due to byte-order issues' - ); - } - } - public static function provideValid() { return [ [ 'calc.xls', 'application/vnd.ms-excel' ], diff --git a/tests/phpunit/unit/includes/libs/mime/MimeAnalyzerTest.php b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php index e78489d7bf22..194781207e9f 100644 --- a/tests/phpunit/unit/includes/libs/mime/MimeAnalyzerTest.php +++ b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php @@ -69,7 +69,7 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { * MEDIATYPE_VIDEO (T65584) */ function testOggRecognize() { - $oggFile = __DIR__ . '/../../../../data/media/say-test.ogg'; + $oggFile = __DIR__ . '/../../../data/media/say-test.ogg'; $actualType = $this->mimeAnalyzer->getMediaType( $oggFile, 'application/ogg' ); $this->assertEquals( MEDIATYPE_AUDIO, $actualType ); } @@ -79,7 +79,7 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { * MEDIATYPE_MULTIMEDIA (bug T151352) */ function testOpusRecognize() { - $oggFile = __DIR__ . '/../../../../data/media/say-test.opus'; + $oggFile = __DIR__ . '/../../../data/media/say-test.opus'; $actualType = $this->mimeAnalyzer->getMediaType( $oggFile, 'application/ogg' ); $this->assertEquals( MEDIATYPE_AUDIO, $actualType ); } @@ -88,7 +88,7 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { * Test to make sure that mp3 files are detected as audio type */ function testMP3AsAudio() { - $file = __DIR__ . '/../../../../data/media/say-test-with-id3.mp3'; + $file = __DIR__ . '/../../../data/media/say-test-with-id3.mp3'; $actualType = $this->mimeAnalyzer->getMediaType( $file ); $this->assertEquals( MEDIATYPE_AUDIO, $actualType ); } @@ -97,7 +97,7 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { * Test to make sure that MP3 with id3 tag is recognized */ function testMP3WithID3Recognize() { - $file = __DIR__ . '/../../../../data/media/say-test-with-id3.mp3'; + $file = __DIR__ . '/../../../data/media/say-test-with-id3.mp3'; $actualType = $this->doGuessMimeType( [ $file, 'mp3' ] ); $this->assertEquals( 'audio/mpeg', $actualType ); } @@ -106,7 +106,7 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { * Test to make sure that MP3 without id3 tag is recognized (MPEG-1 sample rates) */ function testMP3NoID3RecognizeMPEG1() { - $file = __DIR__ . '/../../../../data/media/say-test-mpeg1.mp3'; + $file = __DIR__ . '/../../../data/media/say-test-mpeg1.mp3'; $actualType = $this->doGuessMimeType( [ $file, 'mp3' ] ); $this->assertEquals( 'audio/mpeg', $actualType ); } @@ -115,7 +115,7 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { * Test to make sure that MP3 without id3 tag is recognized (MPEG-2 sample rates) */ function testMP3NoID3RecognizeMPEG2() { - $file = __DIR__ . '/../../../../data/media/say-test-mpeg2.mp3'; + $file = __DIR__ . '/../../../data/media/say-test-mpeg2.mp3'; $actualType = $this->doGuessMimeType( [ $file, 'mp3' ] ); $this->assertEquals( 'audio/mpeg', $actualType ); } @@ -124,7 +124,7 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { * Test to make sure that MP3 without id3 tag is recognized (MPEG-2.5 sample rates) */ function testMP3NoID3RecognizeMPEG2_5() { - $file = __DIR__ . '/../../../../data/media/say-test-mpeg2.5.mp3'; + $file = __DIR__ . '/../../../data/media/say-test-mpeg2.5.mp3'; $actualType = $this->doGuessMimeType( [ $file, 'mp3' ] ); $this->assertEquals( 'audio/mpeg', $actualType ); } @@ -133,13 +133,7 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { * A ZIP file embedded in the middle of a .doc file is still a Word Document. */ function testZipInDoc() { - if ( php_uname( 's' ) === 'Darwin' ) { - $this->markTestSkipped( - 'T225019: Disable this test on macOS for now due to byte-order issues' - ); - } - - $file = __DIR__ . '/../../../../data/media/zip-in-doc.doc'; + $file = __DIR__ . '/../../../data/media/zip-in-doc.doc'; $actualType = $this->doGuessMimeType( [ $file, 'doc' ] ); $this->assertEquals( 'application/msword', $actualType ); } diff --git a/tests/phpunit/unit/includes/libs/objectcache/CachedBagOStuffTest.php b/tests/phpunit/includes/libs/objectcache/CachedBagOStuffTest.php index f953319e6770..f953319e6770 100644 --- a/tests/phpunit/unit/includes/libs/objectcache/CachedBagOStuffTest.php +++ b/tests/phpunit/includes/libs/objectcache/CachedBagOStuffTest.php diff --git a/tests/phpunit/unit/includes/libs/objectcache/HashBagOStuffTest.php b/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php index 332e23b25be9..332e23b25be9 100644 --- a/tests/phpunit/unit/includes/libs/objectcache/HashBagOStuffTest.php +++ b/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php diff --git a/tests/phpunit/unit/includes/libs/objectcache/ReplicatedBagOStuffTest.php b/tests/phpunit/includes/libs/objectcache/ReplicatedBagOStuffTest.php index 64d282f48795..550ec0bd0919 100644 --- a/tests/phpunit/unit/includes/libs/objectcache/ReplicatedBagOStuffTest.php +++ b/tests/phpunit/includes/libs/objectcache/ReplicatedBagOStuffTest.php @@ -1,6 +1,6 @@ <?php -class ReplicatedBagOStuffTest extends \MediaWikiUnitTestCase { +class ReplicatedBagOStuffTest extends MediaWikiTestCase { /** @var HashBagOStuff */ private $writeCache; /** @var HashBagOStuff */ diff --git a/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php index 017d745e49ed..017d745e49ed 100644 --- a/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php +++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/ChronologyProtectorTest.php b/tests/phpunit/includes/libs/rdbms/ChronologyProtectorTest.php index 5901bc108ccd..5901bc108ccd 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/ChronologyProtectorTest.php +++ b/tests/phpunit/includes/libs/rdbms/ChronologyProtectorTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/TransactionProfilerTest.php b/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php index 538d625cc2a2..538d625cc2a2 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/TransactionProfilerTest.php +++ b/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php b/tests/phpunit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php index dd86a73eca57..dd86a73eca57 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php +++ b/tests/phpunit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php b/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php index 8d7d104c1e1f..8d7d104c1e1f 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php +++ b/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/database/DBConnRefTest.php b/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php index 33e5c3b3fb20..33e5c3b3fb20 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/database/DBConnRefTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseDomainTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseDomainTest.php index b1d4fadb7d84..b1d4fadb7d84 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseDomainTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseDomainTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseMssqlTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseMssqlTest.php index 414042ddcf82..414042ddcf82 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseMssqlTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseMssqlTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php index 4c9254512894..4c9254512894 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseSQLTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php index 0e133d8c2c05..0e133d8c2c05 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseSQLTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseSqliteRdbmsTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseSqliteRdbmsTest.php index a886d6bf7635..a886d6bf7635 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseSqliteRdbmsTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseSqliteRdbmsTest.php diff --git a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php index 8b24791ca600..8b24791ca600 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php diff --git a/tests/phpunit/unit/includes/libs/services/ServiceContainerTest.php b/tests/phpunit/includes/libs/services/ServiceContainerTest.php index 6e51883cfb2a..6e51883cfb2a 100644 --- a/tests/phpunit/unit/includes/libs/services/ServiceContainerTest.php +++ b/tests/phpunit/includes/libs/services/ServiceContainerTest.php diff --git a/tests/phpunit/unit/includes/libs/services/TestWiring1.php b/tests/phpunit/includes/libs/services/TestWiring1.php index b6ff4eb3b423..b6ff4eb3b423 100644 --- a/tests/phpunit/unit/includes/libs/services/TestWiring1.php +++ b/tests/phpunit/includes/libs/services/TestWiring1.php diff --git a/tests/phpunit/unit/includes/libs/services/TestWiring2.php b/tests/phpunit/includes/libs/services/TestWiring2.php index dfff64f04889..dfff64f04889 100644 --- a/tests/phpunit/unit/includes/libs/services/TestWiring2.php +++ b/tests/phpunit/includes/libs/services/TestWiring2.php diff --git a/tests/phpunit/unit/includes/libs/stats/PrefixingStatsdDataFactoryProxyTest.php b/tests/phpunit/includes/libs/stats/PrefixingStatsdDataFactoryProxyTest.php index 46e23e36db71..46e23e36db71 100644 --- a/tests/phpunit/unit/includes/libs/stats/PrefixingStatsdDataFactoryProxyTest.php +++ b/tests/phpunit/includes/libs/stats/PrefixingStatsdDataFactoryProxyTest.php diff --git a/tests/phpunit/unit/includes/media/GIFMetadataExtractorTest.php b/tests/phpunit/includes/media/GIFMetadataExtractorTest.php index 10c450d9355e..278b441bbd56 100644 --- a/tests/phpunit/unit/includes/media/GIFMetadataExtractorTest.php +++ b/tests/phpunit/includes/media/GIFMetadataExtractorTest.php @@ -3,12 +3,12 @@ /** * @group Media */ -class GIFMetadataExtractorTest extends \MediaWikiUnitTestCase { +class GIFMetadataExtractorTest extends MediaWikiTestCase { protected function setUp() { parent::setUp(); - $this->mediaPath = __DIR__ . '/../../../data/media/'; + $this->mediaPath = __DIR__ . '/../../data/media/'; } /** diff --git a/tests/phpunit/unit/includes/media/IPTCTest.php b/tests/phpunit/includes/media/IPTCTest.php index 430493cd2034..4b3ba0755c79 100644 --- a/tests/phpunit/unit/includes/media/IPTCTest.php +++ b/tests/phpunit/includes/media/IPTCTest.php @@ -3,7 +3,7 @@ /** * @group Media */ -class IPTCTest extends \MediaWikiUnitTestCase { +class IPTCTest extends MediaWikiTestCase { /** * @covers IPTC::getCharset diff --git a/tests/phpunit/unit/includes/media/JpegMetadataExtractorTest.php b/tests/phpunit/includes/media/JpegMetadataExtractorTest.php index 6063f3e9da31..c943cef90610 100644 --- a/tests/phpunit/unit/includes/media/JpegMetadataExtractorTest.php +++ b/tests/phpunit/includes/media/JpegMetadataExtractorTest.php @@ -9,14 +9,14 @@ * @group Media * @covers JpegMetadataExtractor */ -class JpegMetadataExtractorTest extends \MediaWikiUnitTestCase { +class JpegMetadataExtractorTest extends MediaWikiTestCase { protected $filePath; protected function setUp() { parent::setUp(); - $this->filePath = __DIR__ . '/../../../data/media/'; + $this->filePath = __DIR__ . '/../../data/media/'; } /** diff --git a/tests/phpunit/unit/includes/media/MediaHandlerTest.php b/tests/phpunit/includes/media/MediaHandlerTest.php index eb4ece88c4f2..7a052f603552 100644 --- a/tests/phpunit/unit/includes/media/MediaHandlerTest.php +++ b/tests/phpunit/includes/media/MediaHandlerTest.php @@ -3,7 +3,7 @@ /** * @group Media */ -class MediaHandlerTest extends \MediaWikiUnitTestCase { +class MediaHandlerTest extends MediaWikiTestCase { /** * @covers MediaHandler::fitBoxWidth diff --git a/tests/phpunit/unit/includes/media/SVGMetadataExtractorTest.php b/tests/phpunit/includes/media/SVGMetadataExtractorTest.php index 30d10083f43f..6b94d0ae6c8a 100644 --- a/tests/phpunit/unit/includes/media/SVGMetadataExtractorTest.php +++ b/tests/phpunit/includes/media/SVGMetadataExtractorTest.php @@ -4,7 +4,7 @@ * @group Media * @covers SVGMetadataExtractor */ -class SVGMetadataExtractorTest extends \MediaWikiUnitTestCase { +class SVGMetadataExtractorTest extends MediaWikiTestCase { /** * @dataProvider provideSvgFiles @@ -46,7 +46,7 @@ class SVGMetadataExtractorTest extends \MediaWikiUnitTestCase { } public static function provideSvgFiles() { - $base = __DIR__ . '/../../../data/media'; + $base = __DIR__ . '/../../data/media'; return [ [ @@ -143,7 +143,7 @@ class SVGMetadataExtractorTest extends \MediaWikiUnitTestCase { } public static function provideSvgFilesWithXMLMetadata() { - $base = __DIR__ . '/../../../data/media'; + $base = __DIR__ . '/../../data/media'; // phpcs:disable Generic.Files.LineLength $metadata = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <ns4:Work xmlns:ns4="http://creativecommons.org/ns#" rdf:about=""> diff --git a/tests/phpunit/unit/includes/media/WebPHandlerTest.php b/tests/phpunit/includes/media/WebPHandlerTest.php index 6c8600d188c1..ac0ad98eddf4 100644 --- a/tests/phpunit/unit/includes/media/WebPHandlerTest.php +++ b/tests/phpunit/includes/media/WebPHandlerTest.php @@ -3,7 +3,7 @@ /** * @covers WebPHandler */ -class WebPHandlerTest extends \MediaWikiUnitTestCase { +class WebPHandlerTest extends MediaWikiTestCase { public function setUp() { parent::setUp(); // Allocated file for testing @@ -86,14 +86,14 @@ class WebPHandlerTest extends \MediaWikiUnitTestCase { public function provideTestWithFileExtractMetaData() { return [ - [ __DIR__ . '/../../../data/media/2_webp_ll.webp', + [ __DIR__ . '/../../data/media/2_webp_ll.webp', [ 'compression' => 'lossless', 'width' => 386, 'height' => 395 ] ], - [ __DIR__ . '/../../../data/media/2_webp_a.webp', + [ __DIR__ . '/../../data/media/2_webp_a.webp', [ 'compression' => 'lossy', 'animated' => false, @@ -116,9 +116,9 @@ class WebPHandlerTest extends \MediaWikiUnitTestCase { public function provideTestGetImageSize() { return [ // Public domain files from https://developers.google.com/speed/webp/gallery2 - [ __DIR__ . '/../../../data/media/2_webp_a.webp', [ 386, 395 ] ], - [ __DIR__ . '/../../../data/media/2_webp_ll.webp', [ 386, 395 ] ], - [ __DIR__ . '/../../../data/media/webp_animated.webp', [ 300, 225 ] ], + [ __DIR__ . '/../../data/media/2_webp_a.webp', [ 386, 395 ] ], + [ __DIR__ . '/../../data/media/2_webp_ll.webp', [ 386, 395 ] ], + [ __DIR__ . '/../../data/media/webp_animated.webp', [ 300, 225 ] ], // Error cases [ __FILE__, false ], @@ -139,9 +139,9 @@ class WebPHandlerTest extends \MediaWikiUnitTestCase { public function provideTestGetMimeType() { return [ // Public domain files from https://developers.google.com/speed/webp/gallery2 - [ __DIR__ . '/../../../data/media/2_webp_a.webp' ], - [ __DIR__ . '/../../../data/media/2_webp_ll.webp' ], - [ __DIR__ . '/../../../data/media/webp_animated.webp' ], + [ __DIR__ . '/../../data/media/2_webp_a.webp' ], + [ __DIR__ . '/../../data/media/2_webp_ll.webp' ], + [ __DIR__ . '/../../data/media/webp_animated.webp' ], ]; } } diff --git a/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php b/tests/phpunit/includes/objectcache/MemcachedBagOStuffTest.php index eb040b45011a..45971daced46 100644 --- a/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php +++ b/tests/phpunit/includes/objectcache/MemcachedBagOStuffTest.php @@ -2,7 +2,7 @@ /** * @group BagOStuff */ -class MemcachedBagOStuffTest extends \MediaWikiUnitTestCase { +class MemcachedBagOStuffTest extends MediaWikiTestCase { /** @var MemcachedBagOStuff */ private $cache; diff --git a/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php b/tests/phpunit/includes/objectcache/RESTBagOStuffTest.php index 459e3eebc258..dfbca706d6fe 100644 --- a/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php +++ b/tests/phpunit/includes/objectcache/RESTBagOStuffTest.php @@ -4,7 +4,7 @@ * * @covers RESTBagOStuff */ -class RESTBagOStuffTest extends \MediaWikiUnitTestCase { +class RESTBagOStuffTest extends MediaWikiTestCase { /** * @var MultiHttpClient diff --git a/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php b/tests/phpunit/includes/objectcache/RedisBagOStuffTest.php index df5614d8c12c..df5614d8c12c 100644 --- a/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php +++ b/tests/phpunit/includes/objectcache/RedisBagOStuffTest.php diff --git a/tests/phpunit/unit/includes/page/ArticleTest.php b/tests/phpunit/includes/page/ArticleTest.php index 61fb4b6055d6..df4a2817012f 100644 --- a/tests/phpunit/unit/includes/page/ArticleTest.php +++ b/tests/phpunit/includes/page/ArticleTest.php @@ -1,6 +1,6 @@ <?php -class ArticleTest extends \MediaWikiUnitTestCase { +class ArticleTest extends MediaWikiTestCase { /** * @var Title diff --git a/tests/phpunit/unit/includes/parser/ParserPreloadTest.php b/tests/phpunit/includes/parser/ParserPreloadTest.php index 46f07e5231fd..560b921a8dd6 100644 --- a/tests/phpunit/unit/includes/parser/ParserPreloadTest.php +++ b/tests/phpunit/includes/parser/ParserPreloadTest.php @@ -30,7 +30,7 @@ use MediaWiki\MediaWikiServices; * @covers PPNode_Hash_Array * @covers PPNode_Hash_Attr */ -class ParserPreloadTest extends \MediaWikiUnitTestCase { +class ParserPreloadTest extends MediaWikiTestCase { /** * @var Parser */ diff --git a/tests/phpunit/unit/includes/parser/PreprocessorTest.php b/tests/phpunit/includes/parser/PreprocessorTest.php index 59c3075058ce..6b3e05da513f 100644 --- a/tests/phpunit/unit/includes/parser/PreprocessorTest.php +++ b/tests/phpunit/includes/parser/PreprocessorTest.php @@ -26,7 +26,7 @@ use MediaWiki\MediaWikiServices; * @covers PPNode_Hash_Array * @covers PPNode_Hash_Attr */ -class PreprocessorTest extends \MediaWikiUnitTestCase { +class PreprocessorTest extends MediaWikiTestCase { protected $mTitle = 'Page title'; protected $mPPNodeCount = 0; /** @@ -225,7 +225,7 @@ class PreprocessorTest extends \MediaWikiUnitTestCase { * @dataProvider provideFiles */ public function testPreprocessorOutputFiles( $className, $filename ) { - $folder = __DIR__ . "/../../../../parser/preprocess"; + $folder = __DIR__ . "/../../../parser/preprocess"; $wikiText = file_get_contents( "$folder/$filename.txt" ); $output = $this->preprocessToXml( $className, $wikiText ); diff --git a/tests/phpunit/unit/includes/parser/TidyTest.php b/tests/phpunit/includes/parser/TidyTest.php index 1adb6a6444e4..898ef2d1635c 100644 --- a/tests/phpunit/unit/includes/parser/TidyTest.php +++ b/tests/phpunit/includes/parser/TidyTest.php @@ -4,7 +4,7 @@ * @group Parser * @covers MWTidy */ -class TidyTest extends \MediaWikiUnitTestCase { +class TidyTest extends MediaWikiTestCase { protected function setUp() { parent::setUp(); diff --git a/tests/phpunit/unit/includes/password/PasswordFactoryTest.php b/tests/phpunit/includes/password/PasswordFactoryTest.php index 96e74b1072be..a7b35575160c 100644 --- a/tests/phpunit/unit/includes/password/PasswordFactoryTest.php +++ b/tests/phpunit/includes/password/PasswordFactoryTest.php @@ -3,7 +3,7 @@ /** * @covers PasswordFactory */ -class PasswordFactoryTest extends \MediaWikiUnitTestCase { +class PasswordFactoryTest extends MediaWikiTestCase { public function testConstruct() { $pf = new PasswordFactory(); $this->assertEquals( [ '' ], array_keys( $pf->getTypes() ) ); diff --git a/tests/phpunit/unit/includes/password/PasswordTest.php b/tests/phpunit/includes/password/PasswordTest.php index b41c0f41500b..61a514727729 100644 --- a/tests/phpunit/unit/includes/password/PasswordTest.php +++ b/tests/phpunit/includes/password/PasswordTest.php @@ -23,7 +23,7 @@ /** * @covers InvalidPassword */ -class PasswordTest extends \MediaWikiUnitTestCase { +class PasswordTest extends MediaWikiTestCase { public function testInvalidPlaintext() { $passwordFactory = new PasswordFactory(); $invalid = $passwordFactory->newFromPlaintext( null ); diff --git a/tests/phpunit/unit/includes/preferences/FiltersTest.php b/tests/phpunit/includes/preferences/FiltersTest.php index d2b5d05bb360..60b01b880cb0 100644 --- a/tests/phpunit/unit/includes/preferences/FiltersTest.php +++ b/tests/phpunit/includes/preferences/FiltersTest.php @@ -25,7 +25,7 @@ use MediaWiki\Preferences\TimezoneFilter; /** * @group Preferences */ -class FiltersTest extends \MediaWikiUnitTestCase { +class FiltersTest extends MediaWikiTestCase { /** * @covers MediaWiki\Preferences\IntvalFilter::filterFromForm() * @covers MediaWiki\Preferences\IntvalFilter::filterForForm() diff --git a/tests/phpunit/unit/includes/registration/ExtensionJsonValidatorTest.php b/tests/phpunit/includes/registration/ExtensionJsonValidatorTest.php index 77bc23b1a780..46c697f8ba7d 100644 --- a/tests/phpunit/unit/includes/registration/ExtensionJsonValidatorTest.php +++ b/tests/phpunit/includes/registration/ExtensionJsonValidatorTest.php @@ -21,7 +21,7 @@ /** * @covers ExtensionJsonValidator */ -class ExtensionJsonValidatorTest extends \MediaWikiUnitTestCase { +class ExtensionJsonValidatorTest extends MediaWikiTestCase { /** * @dataProvider provideValidate @@ -39,7 +39,7 @@ class ExtensionJsonValidatorTest extends \MediaWikiUnitTestCase { ); } - $dir = __DIR__ . '/../../../data/registration/'; + $dir = __DIR__ . '/../../data/registration/'; $this->assertSame( $expected, $validator->validate( $dir . $file ) diff --git a/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/includes/registration/ExtensionProcessorTest.php index 13de142ae697..cdd5c63eff59 100644 --- a/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php +++ b/tests/phpunit/includes/registration/ExtensionProcessorTest.php @@ -5,7 +5,7 @@ use Wikimedia\TestingAccessWrapper; /** * @covers ExtensionProcessor */ -class ExtensionProcessorTest extends \MediaWikiUnitTestCase { +class ExtensionProcessorTest extends MediaWikiTestCase { private $dir, $dirname; diff --git a/tests/phpunit/unit/includes/registration/VersionCheckerTest.php b/tests/phpunit/includes/registration/VersionCheckerTest.php index e824e3f02ce6..e824e3f02ce6 100644 --- a/tests/phpunit/unit/includes/registration/VersionCheckerTest.php +++ b/tests/phpunit/includes/registration/VersionCheckerTest.php diff --git a/tests/phpunit/unit/includes/resourceloader/DerivativeResourceLoaderContextTest.php b/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php index e178e96f419c..e178e96f419c 100644 --- a/tests/phpunit/unit/includes/resourceloader/DerivativeResourceLoaderContextTest.php +++ b/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php diff --git a/tests/phpunit/unit/includes/resourceloader/MessageBlobStoreTest.php b/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php index d8a94e735dba..e094d92b9dde 100644 --- a/tests/phpunit/unit/includes/resourceloader/MessageBlobStoreTest.php +++ b/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php @@ -1,14 +1,12 @@ <?php -use Wikimedia\Rdbms\Database; -use Wikimedia\Rdbms\LoadBalancer; use Wikimedia\TestingAccessWrapper; /** * @group ResourceLoader * @covers MessageBlobStore */ -class MessageBlobStoreTest extends MediaWikiUnitTestCase { +class MessageBlobStoreTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; use PHPUnit4And6Compat; @@ -23,21 +21,6 @@ class MessageBlobStoreTest extends MediaWikiUnitTestCase { $this->clock = 1301655600.000; $this->wanCache->setMockTime( $this->clock ); - - $lbMock = $this->createMock( LoadBalancer::class ); - $dbMock = $this->getMockBuilder( Database::class ) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $lbMock->expects( $this->any() ) - ->method( 'getConnection' ) - ->willReturn( $dbMock ); - - $lbMockFactory = function () use ( $lbMock ): LoadBalancer { - return $lbMock; - }; - - $this->overrideMwServices( [ 'DBLoadBalancer' => $lbMockFactory ] ); } public function testBlobCreation() { diff --git a/tests/phpunit/unit/includes/resourceloader/ResourceLoaderClientHtmlTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php index 03a3e24ad39b..03a3e24ad39b 100644 --- a/tests/phpunit/unit/includes/resourceloader/ResourceLoaderClientHtmlTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php diff --git a/tests/phpunit/unit/includes/resourceloader/ResourceLoaderContextTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php index 2ec8ea987ae6..2ec8ea987ae6 100644 --- a/tests/phpunit/unit/includes/resourceloader/ResourceLoaderContextTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php diff --git a/tests/phpunit/unit/includes/search/SearchIndexFieldTest.php b/tests/phpunit/includes/search/SearchIndexFieldTest.php index a640c967ccef..8b4119e0d353 100644 --- a/tests/phpunit/unit/includes/search/SearchIndexFieldTest.php +++ b/tests/phpunit/includes/search/SearchIndexFieldTest.php @@ -4,7 +4,7 @@ * @group Search * @covers SearchIndexFieldDefinition */ -class SearchIndexFieldTest extends \MediaWikiUnitTestCase { +class SearchIndexFieldTest extends MediaWikiTestCase { public function getMergeCases() { return [ diff --git a/tests/phpunit/unit/includes/search/SearchSuggestionSetTest.php b/tests/phpunit/includes/search/SearchSuggestionSetTest.php index 02fa5e9cac0b..02fa5e9cac0b 100644 --- a/tests/phpunit/unit/includes/search/SearchSuggestionSetTest.php +++ b/tests/phpunit/includes/search/SearchSuggestionSetTest.php diff --git a/tests/phpunit/unit/includes/session/MetadataMergeExceptionTest.php b/tests/phpunit/includes/session/MetadataMergeExceptionTest.php index 707adfe5b0f7..8cb4302a4e80 100644 --- a/tests/phpunit/unit/includes/session/MetadataMergeExceptionTest.php +++ b/tests/phpunit/includes/session/MetadataMergeExceptionTest.php @@ -2,11 +2,13 @@ namespace MediaWiki\Session; +use MediaWikiTestCase; + /** * @group Session * @covers MediaWiki\Session\MetadataMergeException */ -class MetadataMergeExceptionTest extends \MediaWikiUnitTestCase { +class MetadataMergeExceptionTest extends MediaWikiTestCase { public function testBasics() { $data = [ 'foo' => 'bar' ]; diff --git a/tests/phpunit/unit/includes/session/SessionIdTest.php b/tests/phpunit/includes/session/SessionIdTest.php index 3c7f8cbfdf4a..2b06d971a6ec 100644 --- a/tests/phpunit/unit/includes/session/SessionIdTest.php +++ b/tests/phpunit/includes/session/SessionIdTest.php @@ -2,11 +2,13 @@ namespace MediaWiki\Session; +use MediaWikiTestCase; + /** * @group Session * @covers MediaWiki\Session\SessionId */ -class SessionIdTest extends \MediaWikiUnitTestCase { +class SessionIdTest extends MediaWikiTestCase { public function testEverything() { $id = new SessionId( 'foo' ); diff --git a/tests/phpunit/unit/includes/session/SessionInfoTest.php b/tests/phpunit/includes/session/SessionInfoTest.php index a3a6365fbbee..8f7b2a6e705e 100644 --- a/tests/phpunit/unit/includes/session/SessionInfoTest.php +++ b/tests/phpunit/includes/session/SessionInfoTest.php @@ -2,20 +2,19 @@ namespace MediaWiki\Session; +use MediaWikiTestCase; + /** * @group Session * @group Database * @covers MediaWiki\Session\SessionInfo */ -class SessionInfoTest extends \MediaWikiUnitTestCase { +class SessionInfoTest extends MediaWikiTestCase { public function testBasics() { - $sysopUser = new \User(); - $sysopUser->setName( 'UTSysop' ); - $anonInfo = UserInfo::newAnonymous(); - $userInfo = UserInfo::newFromUser( $sysopUser, true ); - $unverifiedUserInfo = UserInfo::newFromUser( $sysopUser, false ); + $userInfo = UserInfo::newFromName( 'UTSysop', true ); + $unverifiedUserInfo = UserInfo::newFromName( 'UTSysop', false ); try { new SessionInfo( SessionInfo::MIN_PRIORITY - 1, [] ); diff --git a/tests/phpunit/unit/includes/session/SessionProviderTest.php b/tests/phpunit/includes/session/SessionProviderTest.php index 114fa24a3d0e..6ff6a97b8f45 100644 --- a/tests/phpunit/unit/includes/session/SessionProviderTest.php +++ b/tests/phpunit/includes/session/SessionProviderTest.php @@ -2,6 +2,7 @@ namespace MediaWiki\Session; +use MediaWikiTestCase; use Wikimedia\TestingAccessWrapper; /** @@ -9,7 +10,7 @@ use Wikimedia\TestingAccessWrapper; * @group Database * @covers MediaWiki\Session\SessionProvider */ -class SessionProviderTest extends \MediaWikiUnitTestCase { +class SessionProviderTest extends MediaWikiTestCase { public function testBasics() { $manager = new SessionManager(); diff --git a/tests/phpunit/unit/includes/session/SessionTest.php b/tests/phpunit/includes/session/SessionTest.php index 73bf060638ed..a74056d0caaf 100644 --- a/tests/phpunit/unit/includes/session/SessionTest.php +++ b/tests/phpunit/includes/session/SessionTest.php @@ -3,6 +3,7 @@ namespace MediaWiki\Session; use Psr\Log\LogLevel; +use MediaWikiTestCase; use User; use Wikimedia\TestingAccessWrapper; @@ -10,7 +11,7 @@ use Wikimedia\TestingAccessWrapper; * @group Session * @covers MediaWiki\Session\Session */ -class SessionTest extends \MediaWikiUnitTestCase { +class SessionTest extends MediaWikiTestCase { public function testConstructor() { $backend = TestUtils::getDummySessionBackend(); diff --git a/tests/phpunit/unit/includes/session/TokenTest.php b/tests/phpunit/includes/session/TokenTest.php index cab962b3c63d..47976527ca28 100644 --- a/tests/phpunit/unit/includes/session/TokenTest.php +++ b/tests/phpunit/includes/session/TokenTest.php @@ -2,13 +2,14 @@ namespace MediaWiki\Session; +use MediaWikiTestCase; use Wikimedia\TestingAccessWrapper; /** * @group Session * @covers MediaWiki\Session\Token */ -class TokenTest extends \MediaWikiUnitTestCase { +class TokenTest extends MediaWikiTestCase { public function testBasics() { $token = $this->getMockBuilder( Token::class ) diff --git a/tests/phpunit/unit/includes/shell/CommandFactoryTest.php b/tests/phpunit/includes/shell/CommandFactoryTest.php index b031431af75f..b031431af75f 100644 --- a/tests/phpunit/unit/includes/shell/CommandFactoryTest.php +++ b/tests/phpunit/includes/shell/CommandFactoryTest.php diff --git a/tests/phpunit/unit/includes/shell/CommandTest.php b/tests/phpunit/includes/shell/CommandTest.php index 2e031638857d..2e031638857d 100644 --- a/tests/phpunit/unit/includes/shell/CommandTest.php +++ b/tests/phpunit/includes/shell/CommandTest.php diff --git a/tests/phpunit/unit/includes/shell/FirejailCommandTest.php b/tests/phpunit/includes/shell/FirejailCommandTest.php index b87271fd31a6..681c3dcda019 100644 --- a/tests/phpunit/unit/includes/shell/FirejailCommandTest.php +++ b/tests/phpunit/includes/shell/FirejailCommandTest.php @@ -29,11 +29,10 @@ class FirejailCommandTest extends PHPUnit\Framework\TestCase { public function provideBuildFinalCommand() { global $IP; - $basePath = realpath( $IP ); // phpcs:ignore Generic.Files.LineLength $env = "'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'"; - $limit = "/bin/bash '$basePath/includes/shell/limit.sh'"; - $profile = "--profile=$basePath/includes/shell/firejail.profile"; + $limit = "/bin/bash '$IP/includes/shell/limit.sh'"; + $profile = "--profile=$IP/includes/shell/firejail.profile"; $blacklist = '--blacklist=' . realpath( MW_CONFIG_FILE ); $default = "$blacklist --noroot --seccomp --private-dev"; return [ diff --git a/tests/phpunit/unit/includes/site/CachingSiteStoreTest.php b/tests/phpunit/includes/site/CachingSiteStoreTest.php index 92ed1f53e82d..f04d35ca029e 100644 --- a/tests/phpunit/unit/includes/site/CachingSiteStoreTest.php +++ b/tests/phpunit/includes/site/CachingSiteStoreTest.php @@ -27,7 +27,7 @@ * * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ -class CachingSiteStoreTest extends \MediaWikiUnitTestCase { +class CachingSiteStoreTest extends MediaWikiTestCase { /** * @covers CachingSiteStore::getSites diff --git a/tests/phpunit/unit/includes/site/HashSiteStoreTest.php b/tests/phpunit/includes/site/HashSiteStoreTest.php index 8b0d4e080b74..6269fd39dc24 100644 --- a/tests/phpunit/unit/includes/site/HashSiteStoreTest.php +++ b/tests/phpunit/includes/site/HashSiteStoreTest.php @@ -24,7 +24,7 @@ * * @author Katie Filbert < aude.wiki@gmail.com > */ -class HashSiteStoreTest extends \MediaWikiUnitTestCase { +class HashSiteStoreTest extends MediaWikiTestCase { /** * @covers HashSiteStore::getSites diff --git a/tests/phpunit/unit/includes/site/MediaWikiPageNameNormalizerTest.php b/tests/phpunit/includes/site/MediaWikiPageNameNormalizerTest.php index 15894a3d9ac5..15894a3d9ac5 100644 --- a/tests/phpunit/unit/includes/site/MediaWikiPageNameNormalizerTest.php +++ b/tests/phpunit/includes/site/MediaWikiPageNameNormalizerTest.php diff --git a/tests/phpunit/unit/includes/site/SiteExporterTest.php b/tests/phpunit/includes/site/SiteExporterTest.php index 707be45ba3d0..97a43f8d5bf2 100644 --- a/tests/phpunit/unit/includes/site/SiteExporterTest.php +++ b/tests/phpunit/includes/site/SiteExporterTest.php @@ -67,7 +67,7 @@ class SiteExporterTest extends PHPUnit\Framework\TestCase { $this->assertContains( '</sites>', $xml ); // NOTE: HHVM (at least on wmf Jenkins) doesn't like file URLs. - $xsdFile = __DIR__ . '/../../../../../docs/sitelist-1.0.xsd'; + $xsdFile = __DIR__ . '/../../../../docs/sitelist-1.0.xsd'; $xsdData = file_get_contents( $xsdFile ); $document = new DOMDocument(); diff --git a/tests/phpunit/unit/includes/site/SiteImporterTest.php b/tests/phpunit/includes/site/SiteImporterTest.php index dbdbd6fcc217..dbdbd6fcc217 100644 --- a/tests/phpunit/unit/includes/site/SiteImporterTest.php +++ b/tests/phpunit/includes/site/SiteImporterTest.php diff --git a/tests/phpunit/unit/includes/site/SiteImporterTest.xml b/tests/phpunit/includes/site/SiteImporterTest.xml index 720b1faf1a39..720b1faf1a39 100644 --- a/tests/phpunit/unit/includes/site/SiteImporterTest.xml +++ b/tests/phpunit/includes/site/SiteImporterTest.xml diff --git a/tests/phpunit/unit/includes/skins/SkinFactoryTest.php b/tests/phpunit/includes/skins/SkinFactoryTest.php index 8443c8d1f6ab..4289fd918867 100644 --- a/tests/phpunit/unit/includes/skins/SkinFactoryTest.php +++ b/tests/phpunit/includes/skins/SkinFactoryTest.php @@ -1,6 +1,6 @@ <?php -class SkinFactoryTest extends \MediaWikiUnitTestCase { +class SkinFactoryTest extends MediaWikiTestCase { /** * @covers SkinFactory::register diff --git a/tests/phpunit/unit/includes/skins/SkinTemplateTest.php b/tests/phpunit/includes/skins/SkinTemplateTest.php index ec0c9c76b927..6ea5b40b0b0e 100644 --- a/tests/phpunit/unit/includes/skins/SkinTemplateTest.php +++ b/tests/phpunit/includes/skins/SkinTemplateTest.php @@ -7,7 +7,7 @@ * * @author Bene* < benestar.wikimedia@gmail.com > */ -class SkinTemplateTest extends \MediaWikiUnitTestCase { +class SkinTemplateTest extends MediaWikiTestCase { /** * @dataProvider makeListItemProvider */ diff --git a/tests/phpunit/unit/includes/skins/SkinTest.php b/tests/phpunit/includes/skins/SkinTest.php index da42437da378..41ef2b796af9 100644 --- a/tests/phpunit/unit/includes/skins/SkinTest.php +++ b/tests/phpunit/includes/skins/SkinTest.php @@ -1,5 +1,5 @@ <?php -class SkinTest extends \MediaWikiUnitTestCase { +class SkinTest extends MediaWikiTestCase { /** * @covers Skin::getDefaultModules diff --git a/tests/phpunit/unit/includes/sparql/SparqlClientTest.php b/tests/phpunit/includes/sparql/SparqlClientTest.php index 62af48920b3e..62af48920b3e 100644 --- a/tests/phpunit/unit/includes/sparql/SparqlClientTest.php +++ b/tests/phpunit/includes/sparql/SparqlClientTest.php diff --git a/tests/phpunit/unit/includes/specials/ImageListPagerTest.php b/tests/phpunit/includes/specials/ImageListPagerTest.php index ce0972e77dbc..10c6d04c9e5d 100644 --- a/tests/phpunit/unit/includes/specials/ImageListPagerTest.php +++ b/tests/phpunit/includes/specials/ImageListPagerTest.php @@ -8,18 +8,14 @@ * * @group Database */ -class ImageListPagerTest extends \MediaWikiUnitTestCase { +class ImageListPagerTest extends MediaWikiTestCase { /** * @expectedException MWException * @expectedExceptionMessage invalid_field * @covers ImageListPager::formatValue */ public function testFormatValuesThrowException() { - $page = $this->getMockBuilder( ImageListPager::class ) - ->disableOriginalConstructor() - ->setMethods( null ) - ->getMock(); - + $page = new ImageListPager( RequestContext::getMain() ); $page->formatValue( 'invalid_field', 'invalid_value' ); } } diff --git a/tests/phpunit/unit/includes/specials/SpecialUploadTest.php b/tests/phpunit/includes/specials/SpecialUploadTest.php index a8e3ded61148..95026c18d0e1 100644 --- a/tests/phpunit/unit/includes/specials/SpecialUploadTest.php +++ b/tests/phpunit/includes/specials/SpecialUploadTest.php @@ -1,6 +1,6 @@ <?php -class SpecialUploadTest extends \MediaWikiUnitTestCase { +class SpecialUploadTest extends MediaWikiTestCase { /** * @covers SpecialUpload::getInitialPageText * @dataProvider provideGetInitialPageText diff --git a/tests/phpunit/unit/includes/specials/UncategorizedCategoriesPageTest.php b/tests/phpunit/includes/specials/UncategorizedCategoriesPageTest.php index 522ca86e8f57..80bd365f35b6 100644 --- a/tests/phpunit/unit/includes/specials/UncategorizedCategoriesPageTest.php +++ b/tests/phpunit/includes/specials/UncategorizedCategoriesPageTest.php @@ -2,24 +2,7 @@ /** * Tests for Special:Uncategorizedcategories */ -class UncategorizedCategoriesPageTest extends \MediaWikiUnitTestCase { - - protected function setUp() { - parent::setUp(); - - $loadBalancerMock = $this->createMock( LoadBalancer::class ); - - $loadBalancerMock->expects( $this->any() ) - ->method( 'getConnection' ) - ->willReturn( new DatabaseTestHelper( __CLASS__ ) ); - - $loadBalancerMockFactory = function () use ( $loadBalancerMock ): LoadBalancer { - return $loadBalancerMock; - }; - - $this->overrideMwServices( [ 'DBLoadBalancer' => $loadBalancerMockFactory ] ); - } - +class UncategorizedCategoriesPageTest extends MediaWikiTestCase { /** * @dataProvider provideTestGetQueryInfoData * @covers UncategorizedCategoriesPage::getQueryInfo diff --git a/tests/phpunit/unit/includes/tidy/RemexDriverTest.php b/tests/phpunit/includes/tidy/RemexDriverTest.php index 24a5b25770fb..5ad8416b81a8 100644 --- a/tests/phpunit/unit/includes/tidy/RemexDriverTest.php +++ b/tests/phpunit/includes/tidy/RemexDriverTest.php @@ -1,6 +1,6 @@ <?php -class RemexDriverTest extends \MediaWikiUnitTestCase { +class RemexDriverTest extends MediaWikiTestCase { private static $remexTidyTestData = [ [ 'Empty string', diff --git a/tests/phpunit/unit/includes/tidy/html5lib-tests.json b/tests/phpunit/includes/tidy/html5lib-tests.json index 2b1c3e8cdfa2..2b1c3e8cdfa2 100644 --- a/tests/phpunit/unit/includes/tidy/html5lib-tests.json +++ b/tests/phpunit/includes/tidy/html5lib-tests.json diff --git a/tests/phpunit/unit/includes/title/ForeignTitleTest.php b/tests/phpunit/includes/title/ForeignTitleTest.php index ec093cf83b18..f2fccc75771f 100644 --- a/tests/phpunit/unit/includes/title/ForeignTitleTest.php +++ b/tests/phpunit/includes/title/ForeignTitleTest.php @@ -24,7 +24,7 @@ * * @group Title */ -class ForeignTitleTest extends \MediaWikiUnitTestCase { +class ForeignTitleTest extends MediaWikiTestCase { public function basicProvider() { return [ diff --git a/tests/phpunit/unit/includes/title/NaiveForeignTitleFactoryTest.php b/tests/phpunit/includes/title/NaiveForeignTitleFactoryTest.php index de6650a6a5f3..b8cc39f05438 100644 --- a/tests/phpunit/unit/includes/title/NaiveForeignTitleFactoryTest.php +++ b/tests/phpunit/includes/title/NaiveForeignTitleFactoryTest.php @@ -24,7 +24,7 @@ * * @group Title */ -class NaiveForeignTitleFactoryTest extends \MediaWikiUnitTestCase { +class NaiveForeignTitleFactoryTest extends MediaWikiTestCase { public function basicProvider() { return [ diff --git a/tests/phpunit/unit/includes/title/NamespaceAwareForeignTitleFactoryTest.php b/tests/phpunit/includes/title/NamespaceAwareForeignTitleFactoryTest.php index d77797314b70..9aa3578da7ff 100644 --- a/tests/phpunit/unit/includes/title/NamespaceAwareForeignTitleFactoryTest.php +++ b/tests/phpunit/includes/title/NamespaceAwareForeignTitleFactoryTest.php @@ -24,7 +24,7 @@ * * @group Title */ -class NamespaceAwareForeignTitleFactoryTest extends \MediaWikiUnitTestCase { +class NamespaceAwareForeignTitleFactoryTest extends MediaWikiTestCase { public function basicProvider() { return [ diff --git a/tests/phpunit/unit/includes/title/TitleValueTest.php b/tests/phpunit/includes/title/TitleValueTest.php index cd67a9329dc7..bbeb0680079d 100644 --- a/tests/phpunit/unit/includes/title/TitleValueTest.php +++ b/tests/phpunit/includes/title/TitleValueTest.php @@ -24,7 +24,7 @@ * * @group Title */ -class TitleValueTest extends \MediaWikiUnitTestCase { +class TitleValueTest extends MediaWikiTestCase { public function goodConstructorProvider() { return [ diff --git a/tests/phpunit/unit/includes/user/UserArrayFromResultTest.php b/tests/phpunit/includes/user/UserArrayFromResultTest.php index 0b2ce17d6834..4cbfe462dd6a 100644 --- a/tests/phpunit/unit/includes/user/UserArrayFromResultTest.php +++ b/tests/phpunit/includes/user/UserArrayFromResultTest.php @@ -4,7 +4,7 @@ * @author Addshore * @covers UserArrayFromResult */ -class UserArrayFromResultTest extends \MediaWikiUnitTestCase { +class UserArrayFromResultTest extends MediaWikiTestCase { private function getMockResultWrapper( $row = null, $numRows = 1 ) { $resultWrapper = $this->getMockBuilder( Wikimedia\Rdbms\ResultWrapper::class ) diff --git a/tests/phpunit/unit/includes/utils/AvroValidatorTest.php b/tests/phpunit/includes/utils/AvroValidatorTest.php index cf45f9fd5790..cf45f9fd5790 100644 --- a/tests/phpunit/unit/includes/utils/AvroValidatorTest.php +++ b/tests/phpunit/includes/utils/AvroValidatorTest.php diff --git a/tests/phpunit/unit/includes/utils/BatchRowUpdateTest.php b/tests/phpunit/includes/utils/BatchRowUpdateTest.php index 92b0d7a4a45b..52b143393ffc 100644 --- a/tests/phpunit/unit/includes/utils/BatchRowUpdateTest.php +++ b/tests/phpunit/includes/utils/BatchRowUpdateTest.php @@ -1,7 +1,5 @@ <?php -use Wikimedia\Rdbms\ILBFactory; - /** * Tests for BatchRowUpdate and its components * @@ -11,16 +9,9 @@ use Wikimedia\Rdbms\ILBFactory; * @covers BatchRowIterator * @covers BatchRowWriter */ -class BatchRowUpdateTest extends \MediaWikiUnitTestCase { +class BatchRowUpdateTest extends MediaWikiTestCase { public function testWriterBasicFunctionality() { - $lbFactoryMock = $this->createMock( ILBFactory::class ); - $lbFactoryMockProvider = function () use ( $lbFactoryMock ): ILBFactory { - return $lbFactoryMock; - }; - - $this->overrideMwServices( [ 'DBLoadBalancerFactory' => $lbFactoryMockProvider ] ); - $db = $this->mockDb( [ 'update' ] ); $writer = new BatchRowWriter( $db, 'echo_event' ); @@ -30,16 +21,8 @@ class BatchRowUpdateTest extends \MediaWikiUnitTestCase { self::mockUpdate( [ 'and' => 'something', 'else' => 'changed' ] ), ]; - $ticketMock = 'transaction-ticket'; - $db->expects( $this->exactly( count( $updates ) ) ) ->method( 'update' ); - $lbFactoryMock->expects( $this->any() ) - ->method( 'getEmptyTransactionTicket' ) - ->willReturn( $ticketMock ); - $lbFactoryMock->expects( $this->once() ) - ->method( 'commitAndWaitForReplication' ) - ->with( $this->anything(), $ticketMock ); $writer->write( $updates ); } diff --git a/tests/phpunit/unit/includes/utils/ClassCollectorTest.php b/tests/phpunit/includes/utils/ClassCollectorTest.php index 9c7c50f0f6e4..9c7c50f0f6e4 100644 --- a/tests/phpunit/unit/includes/utils/ClassCollectorTest.php +++ b/tests/phpunit/includes/utils/ClassCollectorTest.php diff --git a/tests/phpunit/unit/includes/utils/FileContentsHasherTest.php b/tests/phpunit/includes/utils/FileContentsHasherTest.php index 8bf6779587e9..316d9f429a9c 100644 --- a/tests/phpunit/unit/includes/utils/FileContentsHasherTest.php +++ b/tests/phpunit/includes/utils/FileContentsHasherTest.php @@ -10,7 +10,7 @@ class FileContentsHasherTest extends PHPUnit\Framework\TestCase { public function provideSingleFile() { return array_map( function ( $file ) { return [ $file, file_get_contents( $file ) ]; - }, glob( __DIR__ . '/../../../data/filecontentshasher/*.*' ) ); + }, glob( __DIR__ . '/../../data/filecontentshasher/*.*' ) ); } public function provideMultipleFiles() { diff --git a/tests/phpunit/unit/includes/utils/MWCryptHashTest.php b/tests/phpunit/includes/utils/MWCryptHashTest.php index 94705bff4855..94705bff4855 100644 --- a/tests/phpunit/unit/includes/utils/MWCryptHashTest.php +++ b/tests/phpunit/includes/utils/MWCryptHashTest.php diff --git a/tests/phpunit/unit/includes/utils/MWRestrictionsTest.php b/tests/phpunit/includes/utils/MWRestrictionsTest.php index abdfbb145980..abdfbb145980 100644 --- a/tests/phpunit/unit/includes/utils/MWRestrictionsTest.php +++ b/tests/phpunit/includes/utils/MWRestrictionsTest.php diff --git a/tests/phpunit/unit/includes/utils/UIDGeneratorTest.php b/tests/phpunit/includes/utils/UIDGeneratorTest.php index 6b81a66fea26..6b81a66fea26 100644 --- a/tests/phpunit/unit/includes/utils/UIDGeneratorTest.php +++ b/tests/phpunit/includes/utils/UIDGeneratorTest.php diff --git a/tests/phpunit/unit/includes/utils/ZipDirectoryReaderTest.php b/tests/phpunit/includes/utils/ZipDirectoryReaderTest.php index e8252a19edcd..a1a3fd730934 100644 --- a/tests/phpunit/unit/includes/utils/ZipDirectoryReaderTest.php +++ b/tests/phpunit/includes/utils/ZipDirectoryReaderTest.php @@ -13,7 +13,7 @@ class ZipDirectoryReaderTest extends PHPUnit\Framework\TestCase { protected function setUp() { parent::setUp(); - $this->zipDir = __DIR__ . '/../../../data/zip'; + $this->zipDir = __DIR__ . '/../../data/zip'; } function zipCallback( $entry ) { diff --git a/tests/phpunit/unit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php b/tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php index 556f518e5486..f424b21b3e97 100644 --- a/tests/phpunit/unit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php +++ b/tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php @@ -7,7 +7,7 @@ use MediaWiki\User\UserIdentityValue; * * @covers NoWriteWatchedItemStore */ -class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase { +class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase { public function testAddWatch() { /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */ diff --git a/tests/phpunit/unit/languages/SpecialPageAliasTest.php b/tests/phpunit/languages/SpecialPageAliasTest.php index cce9d0eb0f15..d406c8893370 100644 --- a/tests/phpunit/unit/languages/SpecialPageAliasTest.php +++ b/tests/phpunit/languages/SpecialPageAliasTest.php @@ -11,7 +11,7 @@ * * @author Katie Filbert < aude.wiki@gmail.com > */ -class SpecialPageAliasTest extends \MediaWikiUnitTestCase { +class SpecialPageAliasTest extends MediaWikiTestCase { /** * @coversNothing diff --git a/tests/phpunit/unit/structure/ApiPrefixUniquenessTest.php b/tests/phpunit/structure/ApiPrefixUniquenessTest.php index b937fabddbf2..432986703021 100644 --- a/tests/phpunit/unit/structure/ApiPrefixUniquenessTest.php +++ b/tests/phpunit/structure/ApiPrefixUniquenessTest.php @@ -4,9 +4,8 @@ * Checks that all API query modules, core and extensions, have unique prefixes. * * @group API - * @coversNothing */ -class ApiPrefixUniquenessTest extends \MediaWikiUnitTestCase { +class ApiPrefixUniquenessTest extends MediaWikiTestCase { public function testPrefixes() { $main = new ApiMain( new FauxRequest() ); diff --git a/tests/phpunit/unit/structure/AutoLoaderStructureTest.php b/tests/phpunit/structure/AutoLoaderStructureTest.php index e91159d74b98..37babcef1437 100644 --- a/tests/phpunit/unit/structure/AutoLoaderStructureTest.php +++ b/tests/phpunit/structure/AutoLoaderStructureTest.php @@ -1,10 +1,6 @@ <?php -/** - * @coversNothing - */ -class AutoLoaderStructureTest extends MediaWikiUnitTestCase { - +class AutoLoaderStructureTest extends MediaWikiTestCase { /** * Assert that there were no classes loaded that are not registered with the AutoLoader. * @@ -202,7 +198,7 @@ class AutoLoaderStructureTest extends MediaWikiUnitTestCase { } public function testAutoloadOrder() { - $path = realpath( __DIR__ . '/../../../..' ); + $path = realpath( __DIR__ . '/../../..' ); $oldAutoload = file_get_contents( $path . '/autoload.php' ); $generator = new AutoloadGenerator( $path, 'local' ); $generator->setPsr4Namespaces( AutoLoader::getAutoloadNamespaces() ); diff --git a/tests/phpunit/unit/structure/ContentHandlerSanityTest.php b/tests/phpunit/structure/ContentHandlerSanityTest.php index 7541e59105f7..c8bcd60de3d4 100644 --- a/tests/phpunit/unit/structure/ContentHandlerSanityTest.php +++ b/tests/phpunit/structure/ContentHandlerSanityTest.php @@ -19,10 +19,7 @@ use Wikimedia\TestingAccessWrapper; * http://www.gnu.org/copyleft/gpl.html */ -/** - * @coversNothing - */ -class ContentHandlerSanityTest extends \MediaWikiUnitTestCase { +class ContentHandlerSanityTest extends MediaWikiTestCase { public static function provideHandlers() { $models = ContentHandler::getContentModels(); diff --git a/tests/phpunit/unit/structure/PasswordPolicyStructureTest.php b/tests/phpunit/structure/PasswordPolicyStructureTest.php index 7867722099e0..d7f865d2e77a 100644 --- a/tests/phpunit/unit/structure/PasswordPolicyStructureTest.php +++ b/tests/phpunit/structure/PasswordPolicyStructureTest.php @@ -1,9 +1,6 @@ <?php -/** - * @coversNothing - */ -class PasswordPolicyStructureTest extends \MediaWikiUnitTestCase { +class PasswordPolicyStructureTest extends MediaWikiTestCase { public function provideChecks() { global $wgPasswordPolicy; diff --git a/tests/phpunit/structure/StructureTest.php b/tests/phpunit/structure/StructureTest.php index 45eb2160885f..412ee991f9eb 100644 --- a/tests/phpunit/structure/StructureTest.php +++ b/tests/phpunit/structure/StructureTest.php @@ -21,7 +21,6 @@ class StructureTest extends MediaWikiTestCase { 'ApiQueryContinueTestBase', 'MediaWikiLangTestCase', 'MediaWikiMediaTestCase', - 'MediaWikiUnitTestCase', 'MediaWikiTestCase', 'ResourceLoaderTestCase', 'PHPUnit_Framework_TestCase', diff --git a/tests/phpunit/suite.xml b/tests/phpunit/suite.xml index 6bec661933d2..de68fec17ed7 100644 --- a/tests/phpunit/suite.xml +++ b/tests/phpunit/suite.xml @@ -56,17 +56,6 @@ <testsuite name="documentation"> <directory>documentation</directory> </testsuite> - - <!-- Unit tests separation --> - <testsuite name="unit_includes"> - <directory>unit/includes</directory> - </testsuite> - <testsuite name="unit_languages"> - <directory>unit/languages</directory> - </testsuite> - <testsuite name="unit_structure"> - <directory>unit/structure</directory> - </testsuite> </testsuites> <groups> <exclude> diff --git a/tests/phpunit/unit-tests.xml b/tests/phpunit/unit-tests.xml deleted file mode 100644 index 149f1f25d3c1..000000000000 --- a/tests/phpunit/unit-tests.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<phpunit bootstrap="unit/initUnitTests.php" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd" - colors="true" - backupGlobals="false" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - forceCoversAnnotation="true" - stopOnFailure="false" - timeoutForSmallTests="10" - timeoutForMediumTests="30" - timeoutForLargeTests="60" - beStrictAboutTestsThatDoNotTestAnything="true" - beStrictAboutOutputDuringTests="true" - beStrictAboutTestSize="true" - verbose="false"> - <testsuites> - <testsuite name="includes"> - <directory>unit/includes</directory> - </testsuite> - <testsuite name="languages"> - <directory>unit/languages</directory> - </testsuite> - <testsuite name="structure"> - <directory>unit/structure</directory> - </testsuite> - </testsuites> - <groups> - <exclude> - <group>Utility</group> - <group>Broken</group> - <group>Stub</group> - </exclude> - </groups> - <filter> - <whitelist addUncoveredFilesFromWhitelist="true"> - <directory suffix=".php">../../includes</directory> - <directory suffix=".php">../../languages</directory> - <directory suffix=".php">../../maintenance</directory> - <exclude> - <directory suffix=".php">../../languages/messages</directory> - <file>../../languages/data/normalize-ar.php</file> - <file>../../languages/data/normalize-ml.php</file> - </exclude> - </whitelist> - </filter> -</phpunit> diff --git a/tests/phpunit/unit/includes/api/ApiBlockInfoTraitTest.php b/tests/phpunit/unit/includes/api/ApiBlockInfoTraitTest.php deleted file mode 100644 index ed5a18474383..000000000000 --- a/tests/phpunit/unit/includes/api/ApiBlockInfoTraitTest.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -use Wikimedia\TestingAccessWrapper; -use MediaWiki\Block\DatabaseBlock; -use MediaWiki\Block\SystemBlock; - -/** - * @covers ApiBlockInfoTrait - */ -class ApiBlockInfoTraitTest extends \MediaWikiUnitTestCase { - - protected function setUp() { - parent::setUp(); - - $lbMock = $this->createMock( LoadBalancer::class ); - $lbMock->expects( $this->any() ) - ->method( 'getConnection' ) - ->willReturn( $this->createMock( Database::class ) ); - - $loadBalancerMockFactory = function () use ( $lbMock ): LoadBalancer { - return $lbMock; - }; - - $this->overrideMwServices( [ 'DBLoadBalancer' => $loadBalancerMockFactory ] ); - } - - /** - * @dataProvider provideGetBlockDetails - */ - public function testGetBlockDetails( $blockFactory, $expectedInfo ) { - $mock = $this->getMockForTrait( ApiBlockInfoTrait::class ); - $info = TestingAccessWrapper::newFromObject( $mock )->getBlockDetails( $blockFactory() ); - $subset = array_merge( [ - 'blockid' => null, - 'blockedby' => '', - 'blockedbyid' => 0, - 'blockreason' => '', - 'blockexpiry' => 'infinite', - ], $expectedInfo ); - $this->assertArraySubset( $subset, $info ); - } - - public static function provideGetBlockDetails() { - return [ - 'Sitewide block' => [ - // Defer instantiation to avoid connecting to DB - function () { - return new DatabaseBlock(); - }, - [ 'blockpartial' => false ], - ], - 'Partial block' => [ - function () { - return new DatabaseBlock( [ 'sitewide' => false ] ); - }, - [ 'blockpartial' => true ], - ], - 'System block' => [ - function () { - return new SystemBlock( [ 'systemBlock' => 'proxy' ] ); - }, - [ 'systemblocktype' => 'proxy' ] - ], - ]; - } -} diff --git a/tests/phpunit/unit/includes/exception/ReadOnlyErrorTest.php b/tests/phpunit/unit/includes/exception/ReadOnlyErrorTest.php deleted file mode 100644 index c8460c97eae9..000000000000 --- a/tests/phpunit/unit/includes/exception/ReadOnlyErrorTest.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -/** - * @covers ReadOnlyError - * @author Addshore - */ -class ReadOnlyErrorTest extends \MediaWikiUnitTestCase { - - protected function setUp() { - parent::setUp(); - - $loadBalancerMockFactory = function (): LoadBalancer { - return $this->createMock( LoadBalancer::class ); - }; - - $this->overrideMwServices( [ 'DBLoadBalancer' => $loadBalancerMockFactory ] ); - } - - public function testConstruction() { - $e = new ReadOnlyError(); - $this->assertEquals( 'readonly', $e->title ); - $this->assertEquals( 'readonlytext', $e->msg ); - $this->assertEquals( wfReadOnlyReason() ?: [], $e->params ); - } -} diff --git a/tests/phpunit/unit/initUnitTests.php b/tests/phpunit/unit/initUnitTests.php deleted file mode 100644 index ef32cabae7d6..000000000000 --- a/tests/phpunit/unit/initUnitTests.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * Allows to include a file that assumes to be included in the file scope. - * It makes all globals available in the inclusion scope before including the file, - * then exports all new globals. - * - * @param string $fileName the file to include - */ -function wfRequireOnceInGlobalScope( $fileName ) { - // phpcs:disable MediaWiki.Usage.ForbiddenFunctions.extract - extract( $GLOBALS, EXTR_REFS | EXTR_SKIP ); - // phpcs:enable - - require_once $fileName; - - foreach ( get_defined_vars() as $varName => $value ) { - $GLOBALS[$varName] = $value; - } -} - -define( 'MEDIAWIKI', true ); -define( 'MW_PHPUNIT_TEST', true ); - -// Inject test configuration via callback, bypassing LocalSettings.php -define( 'MW_CONFIG_CALLBACK', '\TestSetup::applyInitialConfig' ); -// We don't use a settings file here but some code still assumes that one exists -define( 'MW_CONFIG_FILE', 'LocalSettings.php' ); - -$IP = realpath( __DIR__ . '/../../..' ); - -// these variables must be defined before setup runs -$GLOBALS['IP'] = $IP; -$GLOBALS['wgCommandLineMode'] = true; - -// Bypass Setup.php's scope test -$GLOBALS['wgScopeTest'] = 'MediaWiki Setup.php scope test'; -// Avoid PHP Notice in Setup.php -$GLOBALS['self'] = 'Unit tests'; - -require_once "$IP/tests/common/TestSetup.php"; - -wfRequireOnceInGlobalScope( "$IP/includes/AutoLoader.php" ); -wfRequireOnceInGlobalScope( "$IP/includes/Defines.php" ); -wfRequireOnceInGlobalScope( "$IP/includes/DefaultSettings.php" ); -wfRequireOnceInGlobalScope( "$IP/includes/Setup.php" ); - -require_once "$IP/tests/common/TestsAutoLoader.php"; - -// Remove MWExceptionHandler's handling of PHP errors to allow PHPUnit to replace them -restore_error_handler(); - -unset( $GLOBALS['wgScopeTest'] ); - -// Disable all database connections -\MediaWiki\MediaWikiServices::disableStorageBackend(); |