Skip to content

Commit

Permalink
pkp#10306 added not to perform assertion on void return type method
Browse files Browse the repository at this point in the history
  • Loading branch information
touhidurabir committed Sep 4, 2024
1 parent 5306724 commit bde3742
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 22 deletions.
4 changes: 3 additions & 1 deletion tests/jobs/bulk/BulkEmailSenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public function testRunSerializedJob(): void

app()->instance(UserRepository::class, $userRepoMock);

$this->assertNull($bulkEmailSenderJob->handle());
$bulkEmailSenderJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/doi/DepositContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public function testRunSerializedJob(): void

app()->instance(DoiRepository::class, $doiRepoMock);

$this->assertNull($depositContextJob->handle());
$depositContextJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/doi/DepositSubmissionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ public function testRunSerializedJob(): void

app()->instance(DoiRepository::class, $doiRepoMock);

$this->assertNull($depositSubmissionJob->handle());
$depositSubmissionJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/email/EditorialReminderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public function testRunSerializedJob(): void

app()->instance(EmailTemplateRepository::class, $emailTemplateRepoMock);

$this->assertNull($editorialReminderJob->handle());
$editorialReminderJob->handle();

$this->expectNotToPerformAssertions();
}
}
5 changes: 3 additions & 2 deletions tests/jobs/invitations/RemoveExpiredInvitationsJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public function testRunSerializedJob(): void
/** @var RemoveExpiredInvitationsJob $removeExpiredInvitationsJob */
$removeExpiredInvitationsJob = unserialize($this->serializedJobData);

// Test that the job can be handled without causing an exception.
$this->assertNull($removeExpiredInvitationsJob->handle());
$removeExpiredInvitationsJob->handle();

$this->expectNotToPerformAssertions();
}
}

4 changes: 3 additions & 1 deletion tests/jobs/metadata/BatchMetadataChangedJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public function testRunSerializedJob(): void
DAORegistry::registerDAO('MonographSearchDAO', $submissionSearchDAOMock); // for OMP
DAORegistry::registerDAO('PreprintSearchDAO', $submissionSearchDAOMock); // for OPS

$this->assertNull($batchMetadataChangedJob->handle());
$batchMetadataChangedJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/metadata/MetadataChangedJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public function testRunSerializedJob(): void
DAORegistry::registerDAO('MonographSearchDAO', $submissionSearchDAOMock); // for OMP
DAORegistry::registerDAO('PreprintSearchDAO', $submissionSearchDAOMock); // for OPS

$this->assertNull($metadataChangedJob->handle());
$metadataChangedJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/notifications/NewAnnouncementNotifyUsersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public function testRunSerializedJob(): void

app()->instance(UserRepository::class, $userRepoMock);

$this->assertNull($newAnnouncementNotifyUsersJob->handle());
$newAnnouncementNotifyUsersJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/notifications/StatisticsReportMailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ public function testRunSerializedJob(): void

app()->instance(UserRepository::class, $userRepoMock);

$this->assertNull($statisticsReportMailJob->handle());
$statisticsReportMailJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/notifications/StatisticsReportNotifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public function testRunSerializedJob(): void

app()->instance(UserRepository::class, $userRepoMock);

$this->assertNull($statisticsReportNotifyJob->handle());
$statisticsReportNotifyJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/statistics/ArchiveUsageStatsLogFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testRunSerializedJob(): void
// we need to create a dummy file if not existed as to avoid mocking PHP's built in functions
$dummyFileName = $this->createDummyFileIfNeeded($archiveUsageStatsLogFileJob, 'loadId');

$this->assertNull($archiveUsageStatsLogFileJob->handle());
$archiveUsageStatsLogFileJob->handle();

if ($dummyFileName) {
unlink(
Expand All @@ -69,6 +69,8 @@ public function testRunSerializedJob(): void
.$dummyFileName
);
}

$this->expectNotToPerformAssertions();
}

/**
Expand Down
4 changes: 3 additions & 1 deletion tests/jobs/statistics/CompileContextMetricsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public function testRunSerializedJob(): void

DAORegistry::registerDAO('TemporaryTotalsDAO', $temporaryTotalsDAOMock);

$this->assertNull($compileContextMetricsJob->handle());
$compileContextMetricsJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/statistics/CompileMonthlyMetricsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public function testRunSerializedJob(): void

app()->instance('sushiStats', $statsSushiService);

$this->assertNull($compileMonthlyMetricsJob->handle());
$compileMonthlyMetricsJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/statistics/CompileSubmissionMetricsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public function testRunSerializedJob(): void

DAORegistry::registerDAO('TemporaryTotalsDAO', $temporaryTotalsDAOMock);

$this->assertNull($compileSubmissionMetricsJob->handle());
$compileSubmissionMetricsJob->handle();

$this->expectNotToPerformAssertions();
}
}
4 changes: 3 additions & 1 deletion tests/jobs/statistics/RemoveDoubleClicksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public function testRunSerializedJob(): void

DAORegistry::registerDAO('TemporaryTotalsDAO', $temporaryTotalsDAOMock);

$this->assertNull($removeDoubleClicksJob->handle());
$removeDoubleClicksJob->handle();

$this->expectNotToPerformAssertions();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public function testRunSerializedJob(): void
DAORegistry::registerDAO('MonographSearchDAO', $submissionSearchDAOMock); // for OMP
DAORegistry::registerDAO('PreprintSearchDAO', $submissionSearchDAOMock); // for OPS

// Test that the job can be handled without causing an exception.
$this->assertNull($removeSubmissionFileFromSearchIndexJob->handle());
$removeSubmissionFileFromSearchIndexJob->handle();

$this->expectNotToPerformAssertions();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public function testRunSerializedJob(): void
DAORegistry::registerDAO('MonographSearchDAO', $submissionSearchDAOMock); // for OMP
DAORegistry::registerDAO('PreprintSearchDAO', $submissionSearchDAOMock); // for OPS

// Test that the job can be handled without causing an exception.
$this->assertNull($removeSubmissionFromSearchIndexJob->handle());
$removeSubmissionFromSearchIndexJob->handle();

$this->expectNotToPerformAssertions();
}
}

5 changes: 3 additions & 2 deletions tests/jobs/submissions/UpdateSubmissionSearchJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ public function testRunSerializedJob(): void

app()->instance(\APP\submission\Repository::class, $mock);

// Test that the job can be handled without causing an exception.
$this->assertNull($updateSubmissionSearchJob->handle());
$updateSubmissionSearchJob->handle();

$this->expectNotToPerformAssertions();
}
}

0 comments on commit bde3742

Please sign in to comment.