@@ -94,7 +94,7 @@ private function clearDB(): void
9494
9595 if (!empty ($ this ->editorsUsersIds )) {
9696 foreach ($ this ->editorsUsersIds as $ editorUserId ) {
97- $ editorUser = Repo::user ()->get ($ editorUserId );
97+ $ editorUser = Repo::user ()->get ($ editorUserId, true );
9898 if ($ editorUser ) {
9999 Repo::user ()->delete ($ editorUser );
100100 }
@@ -353,6 +353,40 @@ public function testSubmissionGetsJournalEditors(): void
353353 $ this ->assertEquals ($ expectedEditors , $ scieloArticle ->getJournalEditors ());
354354 }
355355
356+ /**
357+ * @group OJS
358+ */
359+ public function testSubmissionGetsDisabledJournalEditors (): void
360+ {
361+ $ journalEditorsData = [
362+ [
363+ 'userName ' => 'examplePeter ' ,
364+ 'email ' => 'peter@example.com ' ,
365+ 'password ' => 'examplepass ' ,
366+ 'givenName ' => [$ this ->locale => "Peter " ],
367+ 'familyName ' => [$ this ->locale => "Parker " ],
368+ 'dateRegistered ' => Core::getCurrentDate ()
369+ ],
370+ [
371+ 'userName ' => 'exampleCharles ' ,
372+ 'email ' => 'charles@example.com ' ,
373+ 'password ' => 'examplepass ' ,
374+ 'givenName ' => [$ this ->locale => "Charles " ],
375+ 'familyName ' => [$ this ->locale => "Xavier " ],
376+ 'dateRegistered ' => Core::getCurrentDate (),
377+ 'disabled ' => true
378+ ]
379+ ];
380+ $ editorsUsers = $ this ->createEditorUsers ($ journalEditorsData );
381+
382+ $ articleFactory = new ScieloArticleFactory ();
383+ $ scieloArticle = $ articleFactory ->createSubmission ($ this ->submissionId , $ this ->locale );
384+
385+ $ expectedEditors = $ editorsUsers [0 ]->getFullName ()
386+ . ", " . $ editorsUsers [1 ]->getFullName ();
387+ $ this ->assertEquals ($ expectedEditors , $ scieloArticle ->getJournalEditors ());
388+ }
389+
356390 /**
357391 * @group OJS
358392 */
@@ -385,6 +419,28 @@ public function testSubmissionGetsSectionEditor(): void
385419 $ this ->assertEquals ($ sectionEditorsUser ->getFullName (), $ scieloArticle ->getSectionEditor ());
386420 }
387421
422+ /**
423+ * @group OJS
424+ */
425+ public function testSubmissionGetsDisabledSectionEditor (): void
426+ {
427+ $ sectionEditorData = [
428+ 'userName ' => 'exampleCharles ' ,
429+ 'email ' => 'charles@example.com ' ,
430+ 'password ' => 'examplepass ' ,
431+ 'givenName ' => [$ this ->locale => "Charles " ],
432+ 'familyName ' => [$ this ->locale => "Xavier " ],
433+ 'dateRegistered ' => Core::getCurrentDate (),
434+ 'disabled ' => true
435+ ];
436+ $ sectionEditorsUser = $ this ->createEditorUsers ([$ sectionEditorData ], true )[0 ];
437+
438+ $ articleFactory = new ScieloArticleFactory ();
439+ $ scieloArticle = $ articleFactory ->createSubmission ($ this ->submissionId , $ this ->locale );
440+
441+ $ this ->assertEquals ($ sectionEditorsUser ->getFullName (), $ scieloArticle ->getSectionEditor ());
442+ }
443+
388444 /**
389445 * @group OJS
390446 */
0 commit comments