From 67d8a83aa4e11b727d83837197c6277ddd89a3dd Mon Sep 17 00:00:00 2001 From: Nicolas Joubert Date: Mon, 2 Nov 2026 16:01:42 +0100 Subject: [PATCH] #90 - FileFetchTaskTest: configure the expectations of the mocks, no more PHPUnit notices Co-Authored-By: Claude Opus 5.5 --- tests/Task/FileFetchTaskTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/Task/FileFetchTaskTest.php b/tests/Task/FileFetchTaskTest.php index 0bd010f..38fa396 100644 --- a/tests/Task/FileFetchTaskTest.php +++ b/tests/Task/FileFetchTaskTest.php @@ -67,11 +67,15 @@ public function testWriteFailureKeepsSourceAndFails(): void public function testUnknownStorageFailsAtInitialization(): void { + $this->destination->expects($this->never())->method('writeStream'); + $this->source->expects($this->never())->method('delete'); + $state = $this->createState('unknown'); + $state->expects($this->never())->method('setOutput'); $task = $this->createTask(); $this->expectException(UnexpectedValueException::class); $this->expectExceptionMessage('Unknown storage "unknown" (option "destination_filesystem"), known storages: "source", "destination"'); - $task->initialize($this->createState('unknown')); + $task->initialize($state); } public function testTaskFailsExplicitlyWhenExecutedAfterAFailedInitialization(): void @@ -85,6 +89,8 @@ public function testTaskFailsExplicitlyWhenExecutedAfterAFailedInitialization(): } $this->destination->expects($this->never())->method('writeStream'); + $this->source->expects($this->never())->method('delete'); + $state->expects($this->never())->method('setOutput'); $this->expectException(UnexpectedValueException::class); $this->expectExceptionMessage('The storages of the task are not available: its initialization has failed, see the previous error'); $task->execute($state);