File tree Expand file tree Collapse file tree
tests/integration/database Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525
2626namespace OCA \Deck \Db ;
2727
28+ use OCA \Deck \NotFoundException ;
2829use OCA \Deck \Service \CirclesService ;
2930use OCP \AppFramework \Db \Entity ;
3031use OCP \AppFramework \Db \QBMapper ;
@@ -97,7 +98,7 @@ public function findBoardId($cardId) {
9798 public function insert (Entity $ entity ): Entity {
9899 $ origin = $ this ->getOrigin ($ entity );
99100 if ($ origin === null ) {
100- throw new \ Exception ('No origin found for assignment ' );
101+ throw new NotFoundException ('No origin found for assignment ' );
101102 }
102103 /** @var AssignedUsers $assignment */
103104 $ assignment = parent ::insert ($ entity );
Original file line number Diff line number Diff line change 2323
2424namespace OCA \Deck \Db ;
2525
26+ use OCA \Deck \NotFoundException ;
2627use OCA \Deck \Service \AssignmentService ;
2728use OCA \Deck \Service \BoardService ;
2829use OCA \Deck \Service \StackService ;
@@ -165,8 +166,8 @@ public function testInsertInvalidUser() {
165166 $ assignment ->setCardId ($ this ->cards [1 ]->getId ());
166167 $ assignment ->setParticipant ('invalid-username ' );
167168 $ assignment ->setType (AssignedUsers::TYPE_USER );
168- $ actual = $ this ->assignedUsersMapper -> insert ( $ assignment );
169- $ this ->assertNull ( $ actual );
169+ $ this ->expectException (NotFoundException::class );
170+ $ this ->assignedUsersMapper -> insert ( $ assignment );
170171 }
171172
172173 /**
You can’t perform that action at this time.
0 commit comments