test pdf path removal
This commit is contained in:
parent
9bbabc7fa6
commit
28f4114def
3 changed files with 29 additions and 58 deletions
|
|
@ -125,7 +125,7 @@ class UpdateElementTest extends TestCase
|
|||
$this->assertSame('Updated title', $persistedElement->getTitle());
|
||||
}
|
||||
|
||||
public function testLegacyPdfPathUpdatesShortPdfPath(): void
|
||||
public function testLegacyPdfPathIsNotAnUpdateField(): void
|
||||
{
|
||||
$set = $this->createSet(1, 'Baderech');
|
||||
$element = $this->createElement(
|
||||
|
|
@ -140,33 +140,25 @@ class UpdateElementTest extends TestCase
|
|||
null,
|
||||
);
|
||||
|
||||
$updatedElement = $this->updateElement->execute(
|
||||
new UpdateElementRequest(
|
||||
id: $element->getId(),
|
||||
title: null,
|
||||
description: null,
|
||||
iconImageUrl: null,
|
||||
richText: null,
|
||||
shortPdfPath: null,
|
||||
longPdfPath: null,
|
||||
pdfPath: '/assets/pdfs/legacy-updated.pdf',
|
||||
youtubeUrl: null,
|
||||
fileType: null,
|
||||
fileContents: null,
|
||||
fileOriginalName: null,
|
||||
fileMimeType: null,
|
||||
fileSizeBytes: null,
|
||||
)
|
||||
);
|
||||
$this->expectException(BadRequestException::class);
|
||||
$this->expectExceptionMessage('nothing to update');
|
||||
|
||||
$this->assertSame(
|
||||
'/assets/pdfs/legacy-updated.pdf',
|
||||
$updatedElement->getShortPdfPath(),
|
||||
);
|
||||
$this->assertSame(
|
||||
'/assets/pdfs/original-long.pdf',
|
||||
$updatedElement->getLongPdfPath(),
|
||||
);
|
||||
$this->updateElement->execute(new UpdateElementRequest(
|
||||
id: $element->getId(),
|
||||
title: null,
|
||||
description: null,
|
||||
iconImageUrl: null,
|
||||
richText: null,
|
||||
shortPdfPath: null,
|
||||
longPdfPath: null,
|
||||
pdfPath: '/assets/pdfs/legacy-updated.pdf',
|
||||
youtubeUrl: null,
|
||||
fileType: null,
|
||||
fileContents: null,
|
||||
fileOriginalName: null,
|
||||
fileMimeType: null,
|
||||
fileSizeBytes: null,
|
||||
));
|
||||
}
|
||||
|
||||
public function testConvertsEmptyNullableFieldsToNull(): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue