Skip to content

Commit 68b8851

Browse files
test(metadata-loader): assert normalized defaults on error
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 3770e4f commit 68b8851

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/php/Unit/Service/File/MetadataLoaderTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public function testLoadMetadataWithPages(): void {
121121
public function testLoadMetadataLogsWarningOnError(): void {
122122
$file = new File();
123123
$file->setId(1);
124+
$file->setName('document.pdf');
124125
$file->setUserId('user123');
125126
$file->setSignedNodeId(123);
126127

@@ -139,8 +140,9 @@ public function testLoadMetadataLogsWarningOnError(): void {
139140
$service = $this->getService();
140141
$service->loadMetadata($file, $fileData);
141142

142-
// Should not throw exception
143-
$this->assertTrue(true);
143+
$this->assertIsArray($fileData->metadata);
144+
$this->assertSame(0, $fileData->metadata['p']);
145+
$this->assertSame('pdf', $fileData->metadata['extension']);
144146
}
145147

146148
#[DataProvider('provideNodeIdPrecedenceScenarios')]

0 commit comments

Comments
 (0)