Skip to content

Commit

Permalink
Update mediawiki/codesniffer to 41.0
Browse files Browse the repository at this point in the history
And fix the reported violations (all of which I agree with).

This should unblock reenabling the FunctionComment sniff, because it
should now complain in fewer situations.

Change-Id: If95f1adcdca12fb72971b9e57e4426905f69670a
  • Loading branch information
lucaswerkmeister committed Feb 27, 2023
1 parent 8e910f9 commit 2d1cc94
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"swaggest/json-diff": "^3.10.4"
},
"require-dev": {
"mediawiki/mediawiki-codesniffer": "^40.0",
"mediawiki/mediawiki-codesniffer": "^41.0",
"mediawiki/mediawiki-phan-config": "^0.12.0",
"mediawiki/minus-x": "1.1.1",
"php-parallel-lint/php-console-highlighter": "0.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function testGettingNoValue() {
->willReturn( TermFallbackCacheFacade::NO_VALUE );

$value = $facade->get( $entityId, self::REVISION_ID, 'en', TermTypes::TYPE_LABEL );
$this->assertEquals( $value, TermFallbackCacheFacade::NO_VALUE );
$this->assertEquals( TermFallbackCacheFacade::NO_VALUE, $value );
}

public function setProvider() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public function testRejectsPropertyIdChange(): void {
);

$this->assertInstanceOf( PatchItemStatementErrorResponse::class, $response );
$this->assertSame( $response->getCode(), ErrorResponse::INVALID_OPERATION_CHANGED_PROPERTY );
$this->assertSame( ErrorResponse::INVALID_OPERATION_CHANGED_PROPERTY, $response->getCode() );
}

public function testRejectsStatementIdChange(): void {
Expand Down Expand Up @@ -336,7 +336,7 @@ public function testRejectsStatementIdChange(): void {
);

$this->assertInstanceOf( PatchItemStatementErrorResponse::class, $response );
$this->assertSame( $response->getCode(), ErrorResponse::INVALID_OPERATION_CHANGED_STATEMENT_ID );
$this->assertSame( ErrorResponse::INVALID_OPERATION_CHANGED_STATEMENT_ID, $response->getCode() );
}

public function testGivenProtectedItem_returnsErrorResponse(): void {
Expand Down
14 changes: 7 additions & 7 deletions repo/tests/phpunit/includes/Store/Sql/DispatchStatsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function testGetDispatchStats_empty(): void {

$actualStats = $dispatchStats->getDispatchStats();

$this->assertSame( $actualStats, [ 'numberOfChanges' => 0 ] );
$this->assertSame( [ 'numberOfChanges' => 0 ], $actualStats );
}

public function testGetDispatchStats_exact(): void {
Expand All @@ -67,12 +67,12 @@ public function testGetDispatchStats_exact(): void {

$actualStats = $dispatchStats->getDispatchStats();

$this->assertSame( $actualStats, [
$this->assertSame( [
'numberOfChanges' => 3,
'numberOfEntities' => 2,
'freshestTime' => '20211018155646',
'stalestTime' => '20211018155100',
] );
], $actualStats );
}

public function testGetDispatchStats_estimated(): void {
Expand All @@ -87,11 +87,11 @@ public function testGetDispatchStats_estimated(): void {

$actualStats = $dispatchStats->getDispatchStats();

$this->assertSame( $actualStats, [
$this->assertSame( [
'estimatedNumberOfChanges' => 30000,
'freshestTime' => '20211018155646',
'stalestTime' => '20211018155100',
] );
], $actualStats );
}

public function testGetDispatchStats_estimateOutdated(): void {
Expand All @@ -106,11 +106,11 @@ public function testGetDispatchStats_estimateOutdated(): void {

$actualStats = $dispatchStats->getDispatchStats();

$this->assertSame( $actualStats, [
$this->assertSame( [
'minimumNumberOfChanges' => 5001,
'freshestTime' => '20211018155646',
'stalestTime' => '20211018155100',
] );
], $actualStats );
}

}
8 changes: 4 additions & 4 deletions repo/tests/phpunit/includes/WikibasePingbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@ public function testWikibasePingbackSchedules() {
$buffer = $logger->getBuffer();
$this->assertCount( 2, $buffer );
$this->assertSame(
$buffer[0],
[
LogLevel::DEBUG,
'Wikibase\Repo\WikibasePingback::sendPingback: pingback sent OK (' . self::TEST_KEY . ')',
]
],
$buffer[0]
);
$this->assertSame(
$buffer[1],
[
LogLevel::DEBUG,
'Wikibase\Repo\WikibasePingback::sendPingback: pingback sent OK (' . self::TEST_KEY . ')',
]
],
$buffer[1]
);
MWTimestamp::setFakeTime( false );
$logger->clearBuffer();
Expand Down

0 comments on commit 2d1cc94

Please sign in to comment.