Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getPresentationId(){
try {
return $this->presentation->getId();
}
catch (\Exception $ex){
catch (\Throwable $ex){
return 0;
}
}
Expand All @@ -81,7 +81,7 @@ public function getSummitId(): int
try {
return $this->presentation->getSummitId();
}
catch (\Exception $ex){
catch (\Throwable $ex){
return 0;
}
}
Expand Down
13 changes: 13 additions & 0 deletions tests/Unit/Services/PresentationMaterialEventDispatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,17 @@ public function testDeleteMediaUploadDispatchesLifeCycleEventWithoutError(): voi
$this->assertCount(1, $jobs, 'Expected 1 ProcessScheduleEntityLifeCycleEvent for PresentationMediaUpload delete');
$this->assertSame(0, $jobs[0]->summit_id, 'summit_id is 0 here because unsetPresentation() runs before PreRemove - accepted degraded case, not a regression');
}

/**
* Both accessors must survive a material whose owning presentation is not set - the
* state removeMediaUpload() leaves behind before PreRemove fires. A null dereference
* throws \Error, which a catch of \Exception does not cover.
*/
public function testAccessorsReturnZeroWhenPresentationIsNotSet(): void
{
$media_upload = new PresentationMediaUpload();

$this->assertSame(0, $media_upload->getPresentationId());
$this->assertSame(0, $media_upload->getSummitId());
}
}
Loading