Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/Task/FileFetchTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
Loading