@@ -26,16 +26,7 @@ $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
2626class TestGroupsPresenter extends Tester \TestCase
2727{
2828 private $ userLogin = "user2@example.com " ;
29- private $ userPassword = "password2 " ;
30-
3129 private $ adminLogin = "admin@admin.com " ;
32- private $ adminPassword = "admin " ;
33-
34- private $ groupSupervisorLogin = "demoGroupSupervisor@example.com " ;
35- private $ groupSupervisorPassword = "password " ;
36-
37- private $ groupSupervisor2Login = "demoGroupSupervisor2@example.com " ;
38- private $ groupSupervisor2Password = "password " ;
3930
4031 /** @var GroupsPresenter */
4132 protected $ presenter ;
@@ -152,10 +143,7 @@ class TestGroupsPresenter extends Tester\TestCase
152143
153144 public function testListAllGroupsBySupervisor ()
154145 {
155- $ token = PresenterTestHelper::login (
156- $ this ->container ,
157- $ this ->groupSupervisorLogin ,
158- );
146+ PresenterTestHelper::login ($ this ->container , PresenterTestHelper::GROUP_SUPERVISOR_LOGIN );
159147 $ payload = PresenterTestHelper::performPresenterRequest (
160148 $ this ->presenter ,
161149 'V1:Groups ' ,
@@ -167,7 +155,7 @@ class TestGroupsPresenter extends Tester\TestCase
167155
168156 public function testListAllGroupsByAdmin ()
169157 {
170- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
158+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
171159 $ payload = PresenterTestHelper::performPresenterRequest (
172160 $ this ->presenter ,
173161 'V1:Groups ' ,
@@ -179,7 +167,7 @@ class TestGroupsPresenter extends Tester\TestCase
179167
180168 public function testSearchGroupByName ()
181169 {
182- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
170+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
183171 $ payload = PresenterTestHelper::performPresenterRequest (
184172 $ this ->presenter ,
185173 'V1:Groups ' ,
@@ -191,7 +179,7 @@ class TestGroupsPresenter extends Tester\TestCase
191179
192180 public function testSearchGroupByNameIncludingAncestors ()
193181 {
194- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
182+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
195183 $ payload = PresenterTestHelper::performPresenterRequest (
196184 $ this ->presenter ,
197185 'V1:Groups ' ,
@@ -203,7 +191,7 @@ class TestGroupsPresenter extends Tester\TestCase
203191
204192 public function testListGroupIncludingArchived ()
205193 {
206- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
194+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
207195 $ payload = PresenterTestHelper::performPresenterRequest (
208196 $ this ->presenter ,
209197 'V1:Groups ' ,
@@ -215,7 +203,7 @@ class TestGroupsPresenter extends Tester\TestCase
215203
216204 public function testListGroupOnlyArchived ()
217205 {
218- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
206+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
219207 $ payload = PresenterTestHelper::performPresenterRequest (
220208 $ this ->presenter ,
221209 'V1:Groups ' ,
@@ -390,7 +378,7 @@ class TestGroupsPresenter extends Tester\TestCase
390378
391379 public function testAddGroup ()
392380 {
393- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
381+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
394382 $ admin = $ this ->container ->getByType (Users::class)->getByEmail ($ this ->adminLogin );
395383
396384 /** @var Instance $instance */
@@ -445,7 +433,7 @@ class TestGroupsPresenter extends Tester\TestCase
445433
446434 public function testAddOrganizationalGroup ()
447435 {
448- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
436+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
449437 $ admin = $ this ->container ->getByType (Users::class)->getByEmail ($ this ->adminLogin );
450438
451439 /** @var Instance $instance */
@@ -501,7 +489,7 @@ class TestGroupsPresenter extends Tester\TestCase
501489
502490 public function testAddExamGroup ()
503491 {
504- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
492+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
505493 $ admin = $ this ->container ->getByType (Users::class)->getByEmail ($ this ->adminLogin );
506494
507495 /** @var Instance $instance */
@@ -558,7 +546,7 @@ class TestGroupsPresenter extends Tester\TestCase
558546
559547 public function testAddGroupNoAdmin ()
560548 {
561- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
549+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
562550 $ admin = $ this ->container ->getByType (Users::class)->getByEmail ($ this ->adminLogin );
563551
564552 /** @var Instance $instance */
@@ -613,7 +601,7 @@ class TestGroupsPresenter extends Tester\TestCase
613601
614602 public function testValidateAddGroupData ()
615603 {
616- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
604+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
617605
618606 $ instance = $ this ->presenter ->instances ->findAll ()[0 ];
619607
@@ -755,7 +743,7 @@ class TestGroupsPresenter extends Tester\TestCase
755743
756744 public function testRemoveGroup ()
757745 {
758- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
746+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
759747
760748 $ instance = $ this ->presenter ->instances ->findAll ()[0 ];
761749 $ groups = $ this ->presenter ->groups ->findAll ();
@@ -779,7 +767,7 @@ class TestGroupsPresenter extends Tester\TestCase
779767
780768 public function testDetail ()
781769 {
782- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
770+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
783771
784772 $ groups = $ this ->presenter ->groups ->findAll ();
785773 $ group = array_pop ($ groups );
@@ -800,7 +788,7 @@ class TestGroupsPresenter extends Tester\TestCase
800788
801789 public function testSubgroups ()
802790 {
803- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
791+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
804792
805793 $ groups = $ this ->presenter ->groups ->findAll ();
806794 $ group = array_pop ($ groups );
@@ -821,7 +809,7 @@ class TestGroupsPresenter extends Tester\TestCase
821809
822810 public function testMembers ()
823811 {
824- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
812+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
825813
826814 $ groups = $ this ->presenter ->groups ->findAll ();
827815 $ group = array_pop ($ groups );
@@ -851,7 +839,7 @@ class TestGroupsPresenter extends Tester\TestCase
851839
852840 public function testAssignments ()
853841 {
854- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
842+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
855843
856844 $ groups = $ this ->presenter ->groups ->findAll ();
857845 foreach ($ groups as $ group ) {
@@ -871,7 +859,7 @@ class TestGroupsPresenter extends Tester\TestCase
871859
872860 public function testShadowAssignments ()
873861 {
874- $ token = PresenterTestHelper::login ($ this ->container , $ this -> adminLogin );
862+ PresenterTestHelper::loginDefaultAdmin ($ this ->container );
875863
876864 $ groups = $ this ->presenter ->groups ->findAll ();
877865 foreach ($ groups as $ group ) {
@@ -1450,8 +1438,8 @@ class TestGroupsPresenter extends Tester\TestCase
14501438
14511439 private function prepExamGroup (): Group
14521440 {
1453- PresenterTestHelper::login ($ this ->container , $ this -> groupSupervisor2Login );
1454- $ admin = $ this ->presenter ->users ->getByEmail ($ this -> groupSupervisor2Login );
1441+ PresenterTestHelper::login ($ this ->container , PresenterTestHelper:: GROUP_SUPERVISOR2_LOGIN );
1442+ $ admin = $ this ->presenter ->users ->getByEmail (PresenterTestHelper:: GROUP_SUPERVISOR2_LOGIN );
14551443 $ groups = $ this ->getAllGroupsInDepth (
14561444 2 ,
14571445 function (Group $ g ) {
0 commit comments