From 49dd79eabb2b8902559a7a4e8f8fcad54f46b604 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Sun, 15 Sep 2024 22:32:31 +0200 Subject: refactor: Add void return type to PHPUnit test methods Signed-off-by: Christoph Wurst --- tests/lib/TextProcessing/TextProcessingTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/lib/TextProcessing/TextProcessingTest.php') diff --git a/tests/lib/TextProcessing/TextProcessingTest.php b/tests/lib/TextProcessing/TextProcessingTest.php index 9c759e52458..84c5492a4a2 100644 --- a/tests/lib/TextProcessing/TextProcessingTest.php +++ b/tests/lib/TextProcessing/TextProcessingTest.php @@ -184,7 +184,7 @@ class TextProcessingTest extends \Test\TestCase { ); } - public function testShouldNotHaveAnyProviders() { + public function testShouldNotHaveAnyProviders(): void { $this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([]); $this->assertCount(0, $this->manager->getAvailableTaskTypes()); $this->assertFalse($this->manager->hasProviders()); @@ -192,7 +192,7 @@ class TextProcessingTest extends \Test\TestCase { $this->manager->runTask(new \OCP\TextProcessing\Task(FreePromptTaskType::class, 'Hello', 'test', null)); } - public function testProviderShouldBeRegisteredAndRun() { + public function testProviderShouldBeRegisteredAndRun(): void { $this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([ new ServiceRegistration('test', SuccessfulSummaryProvider::class) ]); @@ -205,7 +205,7 @@ class TextProcessingTest extends \Test\TestCase { $this->manager->runTask(new Task(FreePromptTaskType::class, 'Hello', 'test', null)); } - public function testProviderShouldBeRegisteredAndScheduled() { + public function testProviderShouldBeRegisteredAndScheduled(): void { // register provider $this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([ new ServiceRegistration('test', SuccessfulSummaryProvider::class) @@ -256,7 +256,7 @@ class TextProcessingTest extends \Test\TestCase { $this->assertEquals(Task::STATUS_SUCCESSFUL, $task3->getStatus()); } - public function testMultipleProvidersShouldBeRegisteredAndRunCorrectly() { + public function testMultipleProvidersShouldBeRegisteredAndRunCorrectly(): void { $this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([ new ServiceRegistration('test', SuccessfulSummaryProvider::class), new ServiceRegistration('test', FreePromptProvider::class), @@ -275,12 +275,12 @@ class TextProcessingTest extends \Test\TestCase { $this->manager->runTask(new Task(TopicsTaskType::class, 'Hello', 'test', null)); } - public function testNonexistentTask() { + public function testNonexistentTask(): void { $this->expectException(NotFoundException::class); $this->manager->getTask(2147483646); } - public function testTaskFailure() { + public function testTaskFailure(): void { // register provider $this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([ new ServiceRegistration('test', FailingSummaryProvider::class), @@ -331,7 +331,7 @@ class TextProcessingTest extends \Test\TestCase { $this->assertEquals(Task::STATUS_FAILED, $task3->getStatus()); } - public function testOldTasksShouldBeCleanedUp() { + public function testOldTasksShouldBeCleanedUp(): void { $this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([ new ServiceRegistration('test', SuccessfulSummaryProvider::class) ]); -- cgit v1.2.3