aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes')
-rw-r--r--tests/phpunit/includes/EditPageConstraintsTest.php1
-rw-r--r--tests/phpunit/includes/Permissions/PermissionManagerTest.php2
-rw-r--r--tests/phpunit/includes/Revision/ContributionsLookupTest.php1
-rw-r--r--tests/phpunit/includes/Revision/RevisionStoreDbTest.php46
-rw-r--r--tests/phpunit/includes/TitleTest.php4
-rw-r--r--tests/phpunit/includes/api/ApiBaseTest.php4
-rw-r--r--tests/phpunit/includes/api/ApiEditPageTest.php2
-rw-r--r--tests/phpunit/includes/api/ApiMainTest.php2
-rw-r--r--tests/phpunit/includes/api/ApiParseTest.php2
-rw-r--r--tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php1
-rw-r--r--tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php1
-rw-r--r--tests/phpunit/includes/block/BlockManagerTest.php2
-rw-r--r--tests/phpunit/includes/block/DatabaseBlockTest.php5
-rw-r--r--tests/phpunit/includes/cache/MessageCacheTest.php1
-rw-r--r--tests/phpunit/includes/db/LoadBalancerTest.php2
-rw-r--r--tests/phpunit/includes/deferred/RefreshSecondaryDataUpdateTest.php1
-rw-r--r--tests/phpunit/includes/diff/DifferenceEngineTest.php4
-rw-r--r--tests/phpunit/includes/filerepo/file/LocalFileTest.php2
-rw-r--r--tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php1
-rw-r--r--tests/phpunit/includes/import/ImportExportTest.php1
-rw-r--r--tests/phpunit/includes/jobqueue/JobRunnerTest.php2
-rw-r--r--tests/phpunit/includes/page/ArticleTest.php2
-rw-r--r--tests/phpunit/includes/page/ParserOutputAccessTest.php4
-rw-r--r--tests/phpunit/includes/page/WikiPageDbTest.php2
-rw-r--r--tests/phpunit/includes/registration/ExtensionRegistryTest.php2
-rw-r--r--tests/phpunit/includes/shell/ShellTest.php2
-rw-r--r--tests/phpunit/includes/site/CachingSiteStoreTest.php2
-rw-r--r--tests/phpunit/includes/site/DBSiteStoreTest.php2
-rw-r--r--tests/phpunit/includes/specials/SpecialContributionsTest.php2
-rw-r--r--tests/phpunit/includes/specials/SpecialGoToInterwikiTest.php5
-rw-r--r--tests/phpunit/includes/user/TalkPageNotificationManagerTest.php2
-rw-r--r--tests/phpunit/includes/user/UserGroupManagerTest.php8
-rw-r--r--tests/phpunit/includes/user/UserTest.php2
33 files changed, 55 insertions, 67 deletions
diff --git a/tests/phpunit/includes/EditPageConstraintsTest.php b/tests/phpunit/includes/EditPageConstraintsTest.php
index ebb69e6146ba..3e85f36f6c54 100644
--- a/tests/phpunit/includes/EditPageConstraintsTest.php
+++ b/tests/phpunit/includes/EditPageConstraintsTest.php
@@ -90,7 +90,6 @@ class EditPageConstraintsTest extends MediaWikiLangTestCase {
);
$page->clear();
- // sanity check
$content = $page->getContent();
$this->assertInstanceOf( TextContent::class, $content );
$currentText = $content->getText();
diff --git a/tests/phpunit/includes/Permissions/PermissionManagerTest.php b/tests/phpunit/includes/Permissions/PermissionManagerTest.php
index c931de31754a..cc84c86559f3 100644
--- a/tests/phpunit/includes/Permissions/PermissionManagerTest.php
+++ b/tests/phpunit/includes/Permissions/PermissionManagerTest.php
@@ -1116,7 +1116,7 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
public function testAddTemporaryUserRights() {
$permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
$this->overrideUserPermissions( $this->user, [ 'read', 'edit' ] );
- // sanity checks
+
$this->assertEquals( [ 'read', 'edit' ], $permissionManager->getUserPermissions( $this->user ) );
$this->assertFalse( $permissionManager->userHasRight( $this->user, 'move' ) );
diff --git a/tests/phpunit/includes/Revision/ContributionsLookupTest.php b/tests/phpunit/includes/Revision/ContributionsLookupTest.php
index 3347d3e963c6..cba3ce82cd95 100644
--- a/tests/phpunit/includes/Revision/ContributionsLookupTest.php
+++ b/tests/phpunit/includes/Revision/ContributionsLookupTest.php
@@ -368,7 +368,6 @@ class ContributionsLookupTest extends MediaWikiIntegrationTestCase {
__METHOD__
);
- // sanity
$this->assertSame( 2, $this->db->affectedRows() );
// anons should not see suppressed contribs
diff --git a/tests/phpunit/includes/Revision/RevisionStoreDbTest.php b/tests/phpunit/includes/Revision/RevisionStoreDbTest.php
index 4923f42a7260..4c2f8d304010 100644
--- a/tests/phpunit/includes/Revision/RevisionStoreDbTest.php
+++ b/tests/phpunit/includes/Revision/RevisionStoreDbTest.php
@@ -996,7 +996,7 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
public function testGetLatestKnownRevision_foreigh() {
$page = $this->getTestPage();
$status = $this->editPage( $page, __METHOD__ );
- $this->assertTrue( $status->isGood(), 'Sanity: edited a page' );
+ $this->assertTrue( $status->isGood(), 'edited a page' );
/** @var RevisionRecord $revRecord */
$revRecord = $status->value['revision-record'];
$dbDomain = 'some_foreign_wiki';
@@ -2295,13 +2295,13 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$page1 = $this->getTestPage();
$text = __METHOD__ . 'b-ä';
$editStatus = $this->editPage( $page1->getTitle()->getPrefixedDBkey(), $text . '1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
/** @var RevisionRecord $revRecord1 */
$revRecord1 = $editStatus->getValue()['revision-record'];
$page2 = $this->getTestPage( $page1->getTitle()->getPrefixedText() . '_other' );
$editStatus = $this->editPage( $page2->getTitle()->getPrefixedDBkey(), $text . '2' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 2' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 2' );
/** @var RevisionRecord $revRecord2 */
$revRecord2 = $editStatus->getValue()['revision-record'];
@@ -2354,14 +2354,14 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$page1 = $this->getTestPage( __METHOD__ );
$text = __METHOD__ . 'b-ä';
$editStatus = $this->editPage( $page1->getTitle()->getPrefixedDBkey(), $text . '1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
/** @var RevisionRecord $revRecord1 */
$revRecord1 = $editStatus->getValue()['revision-record'];
$page1->doDeleteArticleReal( __METHOD__, $this->getTestSysop()->getUser() );
$page2 = $this->getTestPage( $page1->getTitle()->getPrefixedText() . '_other' );
$editStatus = $this->editPage( $page2->getTitle()->getPrefixedDBkey(), $text . '2' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 2' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 2' );
/** @var RevisionRecord $revRecord2 */
$revRecord2 = $editStatus->getValue()['revision-record'];
$page2->doDeleteArticleReal( __METHOD__, $this->getTestSysop()->getUser() );
@@ -2483,13 +2483,13 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$page1 = $this->getTestPage();
$text = __METHOD__ . 'b-ä';
$editStatus = $this->editPage( $page1->getTitle()->getPrefixedDBkey(), $text . '1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
/** @var RevisionRecord $revRecord1 */
$revRecord1 = $editStatus->getValue()['revision-record'];
$page2 = $this->getTestPage( $otherPageTitle );
$editStatus = $this->editPage( $page2->getTitle()->getPrefixedDBkey(), $text . '2' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 2' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 2' );
/** @var RevisionRecord $revRecord2 */
$revRecord2 = $editStatus->getValue()['revision-record'];
@@ -2644,7 +2644,7 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$page1 = $this->getTestPage();
$text = __METHOD__ . 'b-ä';
$editStatus = $this->editPage( $page1->getTitle()->getPrefixedDBkey(), $text . '1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
/** @var RevisionRecord $rev1 */
$revRecord1 = $editStatus->getValue()['revision-record'];
@@ -2665,7 +2665,7 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$page1 = $this->getTestPage();
$text = __METHOD__ . 'b-ä';
$editStatus = $this->editPage( $page1->getTitle()->getPrefixedDBkey(), $text . '1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
/** @var RevisionRecord $revRecord1 */
$revRecord1 = $editStatus->getValue()['revision-record'];
@@ -2692,7 +2692,7 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$revisionIds = [];
for ( $revNum = 0; $revNum < $NUM; $revNum++ ) {
$editStatus = $this->editPage( $page->getTitle()->getPrefixedDBkey(), 'Revision ' . $revNum );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision ' . $revNum );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision ' . $revNum );
$newRevision = $editStatus->getValue()['revision-record'];
/** @var RevisionRecord $newRevision */
$revisions[] = $newRevision;
@@ -2789,7 +2789,7 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$revisions = [];
for ( $revNum = 0; $revNum < $NUM; $revNum++ ) {
$editStatus = $this->editPage( $page->getTitle()->getPrefixedDBkey(), 'Revision ' . $revNum );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision ' . $revNum );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision ' . $revNum );
$revisions[] = $editStatus->getValue()['revision-record'];
}
@@ -2845,7 +2845,7 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
'',
NS_MAIN,
$users[$revNum] );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision ' . $revNum );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision ' . $revNum );
$revisions[] = $editStatus->getValue()['revision-record'];
}
@@ -2894,10 +2894,10 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$page1 = $this->getTestPage( __METHOD__ );
$page2 = $this->getTestPage( 'Other_Page' );
$editStatus = $this->editPage( $page1->getTitle()->getPrefixedDBkey(), 'Revision 1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
$rev1 = $editStatus->getValue()['revision-record'];
$editStatus = $this->editPage( $page2->getTitle()->getPrefixedDBkey(), 'Revision 1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
$rev2 = $editStatus->getValue()['revision-record'];
$this->expectException( InvalidArgumentException::class );
@@ -2933,14 +2933,14 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
public function testGetFirstRevision( $getPageIdentity ) {
list( $pageTitle, $pageIdentity ) = $getPageIdentity();
$editStatus = $this->editPage( $pageTitle->getPrefixedDBkey(), 'First Revision' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create first revision' );
+ $this->assertTrue( $editStatus->isGood(), 'must create first revision' );
$firstRevId = $editStatus->getValue()['revision-record']->getID();
$editStatus = $this->editPage( $pageTitle->getPrefixedText(), 'New Revision' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create new revision' );
+ $this->assertTrue( $editStatus->isGood(), 'must create new revision' );
$this->assertNotSame(
$firstRevId,
$editStatus->getValue()['revision-record']->getID(),
- 'Sanity: new revision must have different id'
+ 'new revision must have different id'
);
$this->assertSame(
$firstRevId,
@@ -3116,7 +3116,7 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$page1 = $this->getTestPage();
$text = __METHOD__ . 'b-ä';
$editStatus = $this->editPage( $page1->getTitle()->getPrefixedDBkey(), $text . '1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
/** @var RevisionRecord $revRecord1 */
$revRecord1 = $editStatus->getValue()['revision-record'];
@@ -3169,7 +3169,7 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$page1 = $this->getTestPage();
$text = __METHOD__ . 'b-ä';
$editStatus = $this->editPage( $page1->getTitle()->getPrefixedDBkey(), $text . '1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
/** @var RevisionRecord $revRecord1 */
$revRecord1 = $editStatus->getValue()['revision-record'];
@@ -3252,7 +3252,7 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
$page1 = $this->getTestPage();
$text = __METHOD__ . 'b-ä';
$editStatus = $this->editPage( $page1->getTitle()->getPrefixedDBkey(), $text . '1' );
- $this->assertTrue( $editStatus->isGood(), 'Sanity: must create revision 1' );
+ $this->assertTrue( $editStatus->isGood(), 'must create revision 1' );
/** @var RevisionRecord $revRecord1 */
$revRecord1 = $editStatus->getValue()['revision-record'];
@@ -3298,13 +3298,13 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
// Prepare a page with 3 revisions
$page = $this->getExistingTestPage( __METHOD__ );
$status = $this->editPage( $page, 'Content 1' );
- $this->assertTrue( $status->isGood(), 'Sanity: edit 1' );
+ $this->assertTrue( $status->isGood(), 'edit 1' );
$originalRev = $status->value[ 'revision-record' ];
- $this->assertTrue( $this->editPage( $page, 'Content 2' )->isGood(), 'Sanity: edit 2' );
+ $this->assertTrue( $this->editPage( $page, 'Content 2' )->isGood(), 'edit 2' );
$status = $this->editPage( $page, 'Content 1' );
- $this->assertTrue( $status->isGood(), 'Sanity: edit 3' );
+ $this->assertTrue( $status->isGood(), 'edit 3' );
$latestRev = $status->value[ 'revision-record' ];
$store = $this->getServiceContainer()->getRevisionStore();
diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php
index 6c24cd3c8038..7501ca9b7b8d 100644
--- a/tests/phpunit/includes/TitleTest.php
+++ b/tests/phpunit/includes/TitleTest.php
@@ -696,7 +696,7 @@ class TitleTest extends MediaWikiIntegrationTestCase {
$existingTitle1 = $existingPage1->getTitle();
$existingId1 = $existingTitle1->getId();
- $this->assertGreaterThan( 0, $existingId1, 'Sanity: Existing test page should have a positive id' );
+ $this->assertGreaterThan( 0, $existingId1, 'Existing test page should have a positive id' );
$newFromId1 = Title::newFromID( $existingId1 );
$this->assertInstanceOf( Title::class, $newFromId1, 'newFromID returns a title for an existing id' );
@@ -710,7 +710,7 @@ class TitleTest extends MediaWikiIntegrationTestCase {
$existingTitle2 = $existingPage2->getTitle();
$existingId2 = $existingTitle2->getId();
- $this->assertGreaterThan( 0, $existingId2, 'Sanity: Existing test page should have a positive id' );
+ $this->assertGreaterThan( 0, $existingId2, 'Existing test page should have a positive id' );
$newFromId2 = Title::newFromID( $existingId2 );
$this->assertInstanceOf( Title::class, $newFromId2, 'newFromID returns a title for an existing id' );
diff --git a/tests/phpunit/includes/api/ApiBaseTest.php b/tests/phpunit/includes/api/ApiBaseTest.php
index 762d2a75a674..4409cf83c1e1 100644
--- a/tests/phpunit/includes/api/ApiBaseTest.php
+++ b/tests/phpunit/includes/api/ApiBaseTest.php
@@ -1312,7 +1312,7 @@ class ApiBaseTest extends ApiTestCase {
$msg = new Message( 'mainpage' );
- // Sanity check empty array
+ // Check empty array
$expect = Status::newGood();
$this->assertEquals( $expect, $mock->errorArrayToStatus( [] ) );
@@ -1375,7 +1375,7 @@ class ApiBaseTest extends ApiTestCase {
$msg = new Message( 'mainpage' );
- // Sanity check empty array
+ // Check empty array
$expect = Status::newGood();
$test = Status::newGood();
$mock->addBlockInfoToStatus( $test );
diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php
index 3c735b07708f..d1d779048a47 100644
--- a/tests/phpunit/includes/api/ApiEditPageTest.php
+++ b/tests/phpunit/includes/api/ApiEditPageTest.php
@@ -142,7 +142,7 @@ class ApiEditPageTest extends ApiTestCase {
'title' => $name,
'text' => $text, ] );
- $this->assertSame( 'Success', $re['edit']['result'] ); // sanity
+ $this->assertSame( 'Success', $re['edit']['result'] );
}
// -- try append/prepend --------------------------------------------
diff --git a/tests/phpunit/includes/api/ApiMainTest.php b/tests/phpunit/includes/api/ApiMainTest.php
index 5536a9bba343..daefc0cf753f 100644
--- a/tests/phpunit/includes/api/ApiMainTest.php
+++ b/tests/phpunit/includes/api/ApiMainTest.php
@@ -447,7 +447,7 @@ class ApiMainTest extends ApiTestCase {
* Test that 'assert' is processed before module errors
*/
public function testAssertBeforeModule() {
- // Sanity check that the query without assert throws too-many-titles
+ // Check that the query without assert throws too-many-titles
try {
$this->doApiRequest( [
'action' => 'query',
diff --git a/tests/phpunit/includes/api/ApiParseTest.php b/tests/phpunit/includes/api/ApiParseTest.php
index b9bf2d2425e3..97bcad57f525 100644
--- a/tests/phpunit/includes/api/ApiParseTest.php
+++ b/tests/phpunit/includes/api/ApiParseTest.php
@@ -592,7 +592,7 @@ class ApiParseTest extends ApiTestCase {
'prop' => 'headhtml',
] );
- // Just do a rough sanity check
+ // Just do a rough check
$this->assertRegExp( '#<!DOCTYPE.*<html.*<head.*</head>.*<body#s',
$res[0]['parse']['headhtml'] );
$this->assertArrayNotHasKey( 'warnings', $res[0] );
diff --git a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php
index bdfd6b27922c..1ab0c72b6e3a 100644
--- a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php
+++ b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php
@@ -475,7 +475,6 @@ class LocalPasswordPrimaryAuthenticationProviderTest extends \MediaWikiIntegrati
$provider = $this->getProvider( $loginOnly );
- // Sanity check
$loginReq = new PasswordAuthenticationRequest();
$loginReq->action = AuthManager::ACTION_LOGIN;
$loginReq->username = $user;
diff --git a/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php
index cbe8a9ec9a7c..9f02ce905bba 100644
--- a/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php
+++ b/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php
@@ -457,7 +457,6 @@ class TemporaryPasswordPrimaryAuthenticationProviderTest extends \MediaWikiInteg
$provider = $this->getProvider();
- // Sanity check
$loginReq = new PasswordAuthenticationRequest();
$loginReq->action = AuthManager::ACTION_CHANGE;
$loginReq->username = $user;
diff --git a/tests/phpunit/includes/block/BlockManagerTest.php b/tests/phpunit/includes/block/BlockManagerTest.php
index 2157920f1754..d52e6041fca0 100644
--- a/tests/phpunit/includes/block/BlockManagerTest.php
+++ b/tests/phpunit/includes/block/BlockManagerTest.php
@@ -107,7 +107,7 @@ class BlockManagerTest extends MediaWikiIntegrationTestCase {
$this->assertTrue( $onUserGetRightsCalled, 'Extensions should be able to grant rights' );
$this->assertTrue(
$onGetUserBlockCalled,
- 'Sanity check: HookRunner::onGetUserBlock should have been called'
+ 'Check that HookRunner::onGetUserBlock was called'
);
$this->assertNull(
$onGetUserBlockIP,
diff --git a/tests/phpunit/includes/block/DatabaseBlockTest.php b/tests/phpunit/includes/block/DatabaseBlockTest.php
index b001efe1cb32..1802ec98203c 100644
--- a/tests/phpunit/includes/block/DatabaseBlockTest.php
+++ b/tests/phpunit/includes/block/DatabaseBlockTest.php
@@ -218,11 +218,10 @@ class DatabaseBlockTest extends MediaWikiLangTestCase {
$u = User::newFromName( $username );
$u->addToDatabase();
$userId = $u->getId();
- $this->assertNotEquals( 0, $userId, 'sanity' );
+ $this->assertNotEquals( 0, $userId, 'Check user id is not 0' );
TestUser::setPasswordForUser( $u, 'NotRandomPass' );
unset( $u );
- // Sanity check
$this->assertNull(
DatabaseBlock::newFromTarget( $username ),
"$username should not be blocked"
@@ -290,7 +289,7 @@ class DatabaseBlockTest extends MediaWikiLangTestCase {
$user = User::newFromName( 'UserOnForeignWiki' );
$user->addToDatabase();
$userId = $user->getId();
- $this->assertNotEquals( 0, $userId, 'sanity' );
+ $this->assertNotEquals( 0, $userId, 'Check user id is not 0' );
// Foreign perspective (blockee not on current wiki)...
$blockOptions = [
diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php
index 80846101072a..1543748a94e2 100644
--- a/tests/phpunit/includes/cache/MessageCacheTest.php
+++ b/tests/phpunit/includes/cache/MessageCacheTest.php
@@ -80,7 +80,6 @@ class MessageCacheTest extends MediaWikiLangTestCase {
->setContent( SlotRecord::MAIN, $content )
->saveRevision( $summary );
- // sanity
$this->assertNotNull( $newRevision, 'Create page ' . $title->getPrefixedDBkey() );
return $newRevision;
}
diff --git a/tests/phpunit/includes/db/LoadBalancerTest.php b/tests/phpunit/includes/db/LoadBalancerTest.php
index 2c620fc8264b..704f84c89ea6 100644
--- a/tests/phpunit/includes/db/LoadBalancerTest.php
+++ b/tests/phpunit/includes/db/LoadBalancerTest.php
@@ -360,7 +360,7 @@ class LoadBalancerTest extends MediaWikiIntegrationTestCase {
// statements such as CREATE TABLE.
$useAtomicSection = in_array( $db->getType(), [ 'sqlite', 'postgres' ], true );
try {
- $db->dropTable( 'some_table' ); // clear for sanity
+ $db->dropTable( 'some_table' );
$this->assertNotEquals( $db::STATUS_TRX_ERROR, $db->trxStatus() );
if ( $useAtomicSection ) {
diff --git a/tests/phpunit/includes/deferred/RefreshSecondaryDataUpdateTest.php b/tests/phpunit/includes/deferred/RefreshSecondaryDataUpdateTest.php
index 6771c5d7b81b..13144860b79e 100644
--- a/tests/phpunit/includes/deferred/RefreshSecondaryDataUpdateTest.php
+++ b/tests/phpunit/includes/deferred/RefreshSecondaryDataUpdateTest.php
@@ -176,7 +176,6 @@ class RefreshSecondaryDataUpdateTest extends MediaWikiIntegrationTestCase {
$dbw->setFlag( DBO_TRX, $dbw::REMEMBER_PRIOR ); // make queries trigger TRX
$reset = new ScopedCallback( [ $dbw, 'restoreFlags' ] );
- // Sanity check
$this->assertSame( 0, $dbw->trxLevel() );
$dbw->selectRow( 'page', '*', '', __METHOD__ );
if ( !$dbw->trxLevel() ) {
diff --git a/tests/phpunit/includes/diff/DifferenceEngineTest.php b/tests/phpunit/includes/diff/DifferenceEngineTest.php
index bfb20d96663b..c4630a52a454 100644
--- a/tests/phpunit/includes/diff/DifferenceEngineTest.php
+++ b/tests/phpunit/includes/diff/DifferenceEngineTest.php
@@ -341,9 +341,9 @@ class DifferenceEngineTest extends MediaWikiIntegrationTestCase {
}
$page = $this->getNonExistingTestPage( 'Page1' );
- $this->assertTrue( $this->editPage( $page, 'Edit1' )->isGood(), 'Sanity: edited a page' );
+ $this->assertTrue( $this->editPage( $page, 'Edit1' )->isGood(), 'edited a page' );
$rev1 = $page->getRevisionRecord();
- $this->assertTrue( $this->editPage( $page, 'Edit2' )->isGood(), 'Sanity: edited a page' );
+ $this->assertTrue( $this->editPage( $page, 'Edit2' )->isGood(), 'edited a page' );
$rev2 = $page->getRevisionRecord();
$diffEngine = new DifferenceEngine( $this->context );
diff --git a/tests/phpunit/includes/filerepo/file/LocalFileTest.php b/tests/phpunit/includes/filerepo/file/LocalFileTest.php
index 53a44d10b788..3288510f9643 100644
--- a/tests/phpunit/includes/filerepo/file/LocalFileTest.php
+++ b/tests/phpunit/includes/filerepo/file/LocalFileTest.php
@@ -380,7 +380,7 @@ class LocalFileTest extends MediaWikiIntegrationTestCase {
$this->getServiceContainer()->getRepoGroup()->getLocalRepo(),
'20201105235242'
);
- $this->assertInstanceOf( File::class, $file, 'Sanity: created a test file' );
+ $this->assertInstanceOf( File::class, $file, 'Created a test file' );
return $file;
}
diff --git a/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php b/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php
index d6cbe9ff5ea1..5a3ac02a22d0 100644
--- a/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php
+++ b/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php
@@ -55,7 +55,6 @@ class HTMLRestrictionsFieldTest extends PHPUnit\Framework\TestCase {
$this->assertEquals( $value, $restrictions->toArray()['IPAddresses'] );
}
- // sanity
$form->getHTML( $status );
}
diff --git a/tests/phpunit/includes/import/ImportExportTest.php b/tests/phpunit/includes/import/ImportExportTest.php
index 6cd95b07fa2a..a52936e563d3 100644
--- a/tests/phpunit/includes/import/ImportExportTest.php
+++ b/tests/phpunit/includes/import/ImportExportTest.php
@@ -253,7 +253,6 @@ class ImportExportTest extends MediaWikiLangTestCase {
$asserter->setVarMapping( $key, $value );
}
- // sanity check
$dumpData = file_get_contents( $tmpFile );
$this->assertNotEmpty( $dumpData, 'Dump XML' );
diff --git a/tests/phpunit/includes/jobqueue/JobRunnerTest.php b/tests/phpunit/includes/jobqueue/JobRunnerTest.php
index 655223faf281..735a49a891a3 100644
--- a/tests/phpunit/includes/jobqueue/JobRunnerTest.php
+++ b/tests/phpunit/includes/jobqueue/JobRunnerTest.php
@@ -31,7 +31,7 @@ class JobRunnerTest extends MediaWikiIntegrationTestCase {
$str = wfRandomString( 10 );
$this->page = $this->insertPage( $str )['title'];
- $this->assertTrue( $this->page->exists(), 'Sanity: The created page exists' );
+ $this->assertTrue( $this->page->exists(), 'The created page exists' );
$this->jobRunner = MediaWikiServices::getInstance()->getJobRunner();
$jobParams = [
diff --git a/tests/phpunit/includes/page/ArticleTest.php b/tests/phpunit/includes/page/ArticleTest.php
index 26e0481f6c56..b1cabbf5897d 100644
--- a/tests/phpunit/includes/page/ArticleTest.php
+++ b/tests/phpunit/includes/page/ArticleTest.php
@@ -104,7 +104,7 @@ class ArticleTest extends \MediaWikiIntegrationTestCase {
if ( $editPageText !== null ) {
$editedUser = $isEditedBySameUser ? $user1 : $user2;
$editIsGood = $this->editPage( $article->getPage(), $editPageText, '', NS_MAIN, $editedUser )->isGood();
- $this->assertTrue( $editIsGood, 'Sanity: edited a page' );
+ $this->assertTrue( $editIsGood, 'edited a page' );
}
$this->assertSame( $expectedResult, $article->showPatrolFooter() );
}
diff --git a/tests/phpunit/includes/page/ParserOutputAccessTest.php b/tests/phpunit/includes/page/ParserOutputAccessTest.php
index f49f2ab6f454..9c5fd9caeb09 100644
--- a/tests/phpunit/includes/page/ParserOutputAccessTest.php
+++ b/tests/phpunit/includes/page/ParserOutputAccessTest.php
@@ -345,7 +345,7 @@ class ParserOutputAccessTest extends MediaWikiIntegrationTestCase {
$frenchResult = $access->getParserOutput( $page, $frenchOptions );
$this->assertContainsHtml( 'Test', $frenchResult );
- // sanity check that French output was cached
+ // Check that French output was cached
$cachedFrenchOutput =
$access->getCachedParserOutput( $page, $frenchOptions );
$this->assertNotNull( $cachedFrenchOutput, 'French output should be in the cache' );
@@ -531,7 +531,7 @@ class ParserOutputAccessTest extends MediaWikiIntegrationTestCase {
$frenchResult = $access->getParserOutput( $page, $frenchOptions, $oldRev );
$this->assertContainsHtml( 'Test', $frenchResult );
- // sanity check that French output was cached
+ // Check that French output was cached
$cachedFrenchOutput =
$access->getCachedParserOutput( $page, $frenchOptions, $oldRev );
$this->assertNotNull( $cachedFrenchOutput, 'French output should be in the cache' );
diff --git a/tests/phpunit/includes/page/WikiPageDbTest.php b/tests/phpunit/includes/page/WikiPageDbTest.php
index f8e08273960e..9ac77ca5ff2b 100644
--- a/tests/phpunit/includes/page/WikiPageDbTest.php
+++ b/tests/phpunit/includes/page/WikiPageDbTest.php
@@ -916,7 +916,7 @@ class WikiPageDbTest extends MediaWikiLangTestCase {
$page = $this->createPage( $title, $text, $model );
- # sanity check, because this test seems to fail for no reason for some people.
+ # double check, because this test seems to fail for no reason for some people.
$c = $page->getContent();
$this->assertEquals( WikitextContent::class, get_class( $c ) );
diff --git a/tests/phpunit/includes/registration/ExtensionRegistryTest.php b/tests/phpunit/includes/registration/ExtensionRegistryTest.php
index a752d2e8f693..ecbf253565b0 100644
--- a/tests/phpunit/includes/registration/ExtensionRegistryTest.php
+++ b/tests/phpunit/includes/registration/ExtensionRegistryTest.php
@@ -437,7 +437,7 @@ class ExtensionRegistryTest extends MediaWikiIntegrationTestCase {
$registry = new ExtensionRegistry();
$registry->queue( "{$this->dataDir}/good.json" );
$registry->loadFromQueue();
- // Sanity check that it worked
+ // Check that it worked
$this->assertSame( [ 'test' ], $registry->getAttribute( 'FooBarAttr' ) );
$reset = $registry->setAttributeForTest( 'FooBarAttr', [ 'override' ] );
// overridden properly
diff --git a/tests/phpunit/includes/shell/ShellTest.php b/tests/phpunit/includes/shell/ShellTest.php
index ef966abf09fc..fa6cb906f405 100644
--- a/tests/phpunit/includes/shell/ShellTest.php
+++ b/tests/phpunit/includes/shell/ShellTest.php
@@ -10,7 +10,7 @@ use MediaWiki\Shell\Shell;
class ShellTest extends MediaWikiIntegrationTestCase {
public function testIsDisabled() {
- $this->assertIsBool( Shell::isDisabled() ); // sanity
+ $this->assertIsBool( Shell::isDisabled() );
}
/**
diff --git a/tests/phpunit/includes/site/CachingSiteStoreTest.php b/tests/phpunit/includes/site/CachingSiteStoreTest.php
index abbfaf6f5196..10e1d89e6824 100644
--- a/tests/phpunit/includes/site/CachingSiteStoreTest.php
+++ b/tests/phpunit/includes/site/CachingSiteStoreTest.php
@@ -115,7 +115,7 @@ class CachingSiteStoreTest extends \MediaWikiIntegrationTestCase {
$store->getSite( 'enwiki' )->setLanguageCode( 'en-ca' );
- // sanity check: $store should have the new language code for 'enwiki'
+ // check: $store should have the new language code for 'enwiki'
$this->assertEquals( 'en-ca', $store->getSite( 'enwiki' )->getLanguageCode(), 'sanity check' );
// purge cache
diff --git a/tests/phpunit/includes/site/DBSiteStoreTest.php b/tests/phpunit/includes/site/DBSiteStoreTest.php
index c1c5f545072c..b69c9f81379c 100644
--- a/tests/phpunit/includes/site/DBSiteStoreTest.php
+++ b/tests/phpunit/includes/site/DBSiteStoreTest.php
@@ -116,7 +116,7 @@ class DBSiteStoreTest extends MediaWikiIntegrationTestCase {
// cache in $store1, but not the internal cache in store2.
$this->assertTrue( $store1->clear() );
- // sanity check: $store2 should have a stale cache now
+ // check: $store2 should have a stale cache now
$this->assertNotNull( $store2->getSite( 'enwiki' ) );
// purge cache
diff --git a/tests/phpunit/includes/specials/SpecialContributionsTest.php b/tests/phpunit/includes/specials/SpecialContributionsTest.php
index 46f5c9acb549..0af99d1c50f7 100644
--- a/tests/phpunit/includes/specials/SpecialContributionsTest.php
+++ b/tests/phpunit/includes/specials/SpecialContributionsTest.php
@@ -30,7 +30,7 @@ class SpecialContributionsTest extends SpecialPageTestBase {
$this->editPage(
$this->pageName, 'Test Content', 'test', NS_MAIN, $this->admin
)->isOK(),
- 'Sanity: admin contributed'
+ 'Admin contributed'
);
}
diff --git a/tests/phpunit/includes/specials/SpecialGoToInterwikiTest.php b/tests/phpunit/includes/specials/SpecialGoToInterwikiTest.php
index a4ff113c0445..52dc18b89dba 100644
--- a/tests/phpunit/includes/specials/SpecialGoToInterwikiTest.php
+++ b/tests/phpunit/includes/specials/SpecialGoToInterwikiTest.php
@@ -22,12 +22,11 @@ class SpecialGoToInterwikiTest extends MediaWikiIntegrationTestCase {
MediaWikiServices::getInstance()->resetServiceForTesting( 'TitleParser' );
MediaWikiServices::getInstance()->resetServiceForTesting( '_MediaWikiTitleCodec' );
- // sanity check
- $this->assertTrue( !Title::newFromText( 'Foo' )->isExternal() );
+ $this->assertNotTrue( Title::newFromText( 'Foo' )->isExternal() );
$this->assertTrue( Title::newFromText( 'local:Foo' )->isExternal() );
$this->assertTrue( Title::newFromText( 'nonlocal:Foo' )->isExternal() );
$this->assertTrue( Title::newFromText( 'local:Foo' )->isLocal() );
- $this->assertTrue( !Title::newFromText( 'nonlocal:Foo' )->isLocal() );
+ $this->assertNotTrue( Title::newFromText( 'nonlocal:Foo' )->isLocal() );
$goToInterwiki = MediaWikiServices::getInstance()->getSpecialPageFactory()
->getPage( 'GoToInterwiki' );
diff --git a/tests/phpunit/includes/user/TalkPageNotificationManagerTest.php b/tests/phpunit/includes/user/TalkPageNotificationManagerTest.php
index 7222e50f2ffc..ca56ae17446d 100644
--- a/tests/phpunit/includes/user/TalkPageNotificationManagerTest.php
+++ b/tests/phpunit/includes/user/TalkPageNotificationManagerTest.php
@@ -35,7 +35,7 @@ class TalkPageNotificationManagerTest extends MediaWikiIntegrationTestCase {
NS_MAIN,
$this->getTestSysop()->getUser()
);
- $this->assertTrue( $status->isGood(), 'Sanity: create revision of user talk' );
+ $this->assertTrue( $status->isGood(), 'create revision of user talk' );
return $status->getValue()['revision-record'];
}
diff --git a/tests/phpunit/includes/user/UserGroupManagerTest.php b/tests/phpunit/includes/user/UserGroupManagerTest.php
index b5c502ed61a0..2cc642fbd18b 100644
--- a/tests/phpunit/includes/user/UserGroupManagerTest.php
+++ b/tests/phpunit/includes/user/UserGroupManagerTest.php
@@ -181,7 +181,7 @@ class UserGroupManagerTest extends MediaWikiIntegrationTestCase {
$this->assertTrue(
$manager->addUserToGroup( $user, self::GROUP ),
- 'Sanity: added user to group'
+ 'added user to group'
);
$this->assertArrayEquals(
[ '*', 'user', 'autoconfirmed' ],
@@ -494,7 +494,7 @@ class UserGroupManagerTest extends MediaWikiIntegrationTestCase {
$expiryInPast = wfTimestamp( TS_MW, time() - 100500 );
$this->assertTrue(
$manager->addUserToGroup( $user, 'expired', $expiryInPast ),
- 'Sanity: can add expired group'
+ 'can add expired group'
);
$manager->purgeExpired();
$this->assertNotContains( 'expired', $manager->getUserGroups( $user ) );
@@ -989,9 +989,9 @@ class UserGroupManagerTest extends MediaWikiIntegrationTestCase {
$manager->removeUserFromGroup( $user, $formerGroup );
}
$this->assertArrayEquals( $userGroups, $manager->getUserGroups( $user ),
- false, 'Sanity: user groups are correct ' );
+ false, 'user groups are correct ' );
$this->assertArrayEquals( $formerGroups, $manager->getUserFormerGroups( $user ),
- false, 'Sanity: user former groups are correct ' );
+ false, 'user former groups are correct ' );
$this->assertArrayEquals(
$expected,
$manager->getUserAutopromoteOnceGroups( $user, 'EVENT' )
diff --git a/tests/phpunit/includes/user/UserTest.php b/tests/phpunit/includes/user/UserTest.php
index 11894fa9cc07..b59869c6e032 100644
--- a/tests/phpunit/includes/user/UserTest.php
+++ b/tests/phpunit/includes/user/UserTest.php
@@ -348,7 +348,6 @@ class UserTest extends MediaWikiIntegrationTestCase {
],
] );
- // Sanity
$this->assertTrue( $this->user->isValidPassword( 'Password1234' ) );
// Minimum length
@@ -784,7 +783,6 @@ class UserTest extends MediaWikiIntegrationTestCase {
'User::saveSettings updates actor table for name change'
);
- // For sanity
$ip = '192.168.12.34';
$this->db->delete( 'actor', [ 'actor_name' => $ip ], __METHOD__ );