@@ -6611,206 +6611,6 @@ public function canViewRegistrationsListWithNeedsRegistrationAndLoginAccess(
6611
6611
);
6612
6612
}
6613
6613
6614
- /**
6615
- * Data provider for testing the canViewRegistrationsList function
6616
- * with world access.
6617
- *
6618
- * @return mixed[][] test data for canViewRegistrationsList with each row
6619
- * having the following elements:
6620
- * [expected] boolean: expected value (TRUE or FALSE)
6621
- * [loggedIn] boolean: whether a user is logged in
6622
- * [isRegistered] boolean: whether the logged-in user is
6623
- * registered for that event
6624
- * [isVip] boolean: whether the logged-in user is a VIP
6625
- * that event
6626
- * [whichPlugin] string: value for that parameter
6627
- * [registrationsListPID] integer: value for that parameter
6628
- * [registrationsVipListPID] integer: value for that parameter
6629
- */
6630
- public function canViewRegistrationsListDataProviderForWorld (): array
6631
- {
6632
- return [
6633
- 'seminarListWithNothingElse ' => [
6634
- 'expected ' => false ,
6635
- 'loggedIn ' => false ,
6636
- 'isRegistered ' => false ,
6637
- 'isVip ' => false ,
6638
- 'whichPlugin ' => 'seminar_list ' ,
6639
- 'registrationsListPID ' => 0 ,
6640
- 'registrationsVipListPID ' => 0 ,
6641
- ],
6642
- 'seminarListWithListPid ' => [
6643
- 'expected ' => true ,
6644
- 'loggedIn ' => false ,
6645
- 'isRegistered ' => false ,
6646
- 'isVip ' => false ,
6647
- 'whichPlugin ' => 'seminar_list ' ,
6648
- 'registrationsListPID ' => 1 ,
6649
- 'registrationsVipListPID ' => 0 ,
6650
- ],
6651
- 'seminarListLoggedInWithListPid ' => [
6652
- 'expected ' => true ,
6653
- 'loggedIn ' => true ,
6654
- 'isRegistered ' => false ,
6655
- 'isVip ' => false ,
6656
- 'whichPlugin ' => 'seminar_list ' ,
6657
- 'registrationsListPID ' => 1 ,
6658
- 'registrationsVipListPID ' => 0 ,
6659
- ],
6660
- 'seminarListIsRegisteredWithListPid ' => [
6661
- 'expected ' => true ,
6662
- 'loggedIn ' => true ,
6663
- 'isRegistered ' => true ,
6664
- 'isVip ' => false ,
6665
- 'whichPlugin ' => 'seminar_list ' ,
6666
- 'registrationsListPID ' => 1 ,
6667
- 'registrationsVipListPID ' => 0 ,
6668
- ],
6669
- 'seminarListIsRegisteredWithoutListPid ' => [
6670
- 'expected ' => false ,
6671
- 'loggedIn ' => true ,
6672
- 'isRegistered ' => true ,
6673
- 'isVip ' => false ,
6674
- 'whichPlugin ' => 'seminar_list ' ,
6675
- 'registrationsListPID ' => 0 ,
6676
- 'registrationsVipListPID ' => 0 ,
6677
- ],
6678
- 'seminarListIsVipWithListPid ' => [
6679
- 'expected ' => false ,
6680
- 'loggedIn ' => true ,
6681
- 'isRegistered ' => true ,
6682
- 'isVip ' => true ,
6683
- 'whichPlugin ' => 'seminar_list ' ,
6684
- 'registrationsListPID ' => 0 ,
6685
- 'registrationsVipListPID ' => 1 ,
6686
- ],
6687
- 'seminarListIsVipWithoutListPid ' => [
6688
- 'expected ' => false ,
6689
- 'loggedIn ' => true ,
6690
- 'isRegistered ' => false ,
6691
- 'isVip ' => true ,
6692
- 'whichPlugin ' => 'seminar_list ' ,
6693
- 'registrationsListPID ' => 0 ,
6694
- 'registrationsVipListPID ' => 0 ,
6695
- ],
6696
- 'myEventsIsRegisteredWithListPid ' => [
6697
- 'expected ' => true ,
6698
- 'loggedIn ' => true ,
6699
- 'isRegistered ' => true ,
6700
- 'isVip ' => false ,
6701
- 'whichPlugin ' => 'my_events ' ,
6702
- 'registrationsListPID ' => 1 ,
6703
- 'registrationsVipListPID ' => 1 ,
6704
- ],
6705
- 'myEventsIsVipWithVipListPid ' => [
6706
- 'expected ' => true ,
6707
- 'loggedIn ' => true ,
6708
- 'isRegistered ' => false ,
6709
- 'isVip ' => true ,
6710
- 'whichPlugin ' => 'my_events ' ,
6711
- 'registrationsListPID ' => 1 ,
6712
- 'registrationsVipListPID ' => 1 ,
6713
- ],
6714
- 'myVipEventsIsRegisteredWithVipListPid ' => [
6715
- 'expected ' => false ,
6716
- 'loggedIn ' => true ,
6717
- 'isRegistered ' => true ,
6718
- 'isVip ' => false ,
6719
- 'whichPlugin ' => 'my_vip_events ' ,
6720
- 'registrationsListPID ' => 1 ,
6721
- 'registrationsVipListPID ' => 1 ,
6722
- ],
6723
- 'myVipEventsIsVipWithVipListPid ' => [
6724
- 'expected ' => true ,
6725
- 'loggedIn ' => true ,
6726
- 'isRegistered ' => false ,
6727
- 'isVip ' => true ,
6728
- 'whichPlugin ' => 'my_vip_events ' ,
6729
- 'registrationsListPID ' => 1 ,
6730
- 'registrationsVipListPID ' => 1 ,
6731
- ],
6732
- 'listRegistrationsIsRegistered ' => [
6733
- 'expected ' => true ,
6734
- 'loggedIn ' => true ,
6735
- 'isRegistered ' => true ,
6736
- 'isVip ' => false ,
6737
- 'whichPlugin ' => 'list_registrations ' ,
6738
- 'registrationsListPID ' => 0 ,
6739
- 'registrationsVipListPID ' => 0 ,
6740
- ],
6741
- 'listRegistrationsIsVip ' => [
6742
- 'expected ' => true ,
6743
- 'loggedIn ' => true ,
6744
- 'isRegistered ' => false ,
6745
- 'isVip ' => true ,
6746
- 'whichPlugin ' => 'list_registrations ' ,
6747
- 'registrationsListPID ' => 0 ,
6748
- 'registrationsVipListPID ' => 0 ,
6749
- ],
6750
- 'listVipRegistrationsIsRegistered ' => [
6751
- 'expected ' => false ,
6752
- 'loggedIn ' => true ,
6753
- 'isRegistered ' => true ,
6754
- 'isVip ' => false ,
6755
- 'whichPlugin ' => 'list_vip_registrations ' ,
6756
- 'registrationsListPID ' => 0 ,
6757
- 'registrationsVipListPID ' => 0 ,
6758
- ],
6759
- 'listVipRegistrationsIsVip ' => [
6760
- 'expected ' => true ,
6761
- 'loggedIn ' => true ,
6762
- 'isRegistered ' => false ,
6763
- 'isVip ' => true ,
6764
- 'whichPlugin ' => 'list_vip_registrations ' ,
6765
- 'registrationsListPID ' => 0 ,
6766
- 'registrationsVipListPID ' => 0 ,
6767
- ],
6768
- ];
6769
- }
6770
-
6771
- /**
6772
- * @test
6773
- *
6774
- * @dataProvider canViewRegistrationsListDataProviderForWorld
6775
- */
6776
- public function canViewRegistrationsListWithNeedsRegistrationAndWorldAccess (
6777
- bool $ expected ,
6778
- bool $ loggedIn ,
6779
- bool $ isRegistered ,
6780
- bool $ isVip ,
6781
- string $ whichPlugin ,
6782
- int $ registrationsListPID ,
6783
- int $ registrationsVipListPID
6784
- ): void {
6785
- $ subject = $ this ->createPartialMock (
6786
- LegacyEvent::class,
6787
- ['needsRegistration ' , 'isUserRegistered ' , 'isUserVip ' ]
6788
- );
6789
- $ subject ->method ('needsRegistration ' )
6790
- ->willReturn (true );
6791
- $ subject ->method ('isUserRegistered ' )
6792
- ->willReturn ($ isRegistered );
6793
- $ subject ->method ('isUserVip ' )
6794
- ->willReturn ($ isVip );
6795
-
6796
- if ($ loggedIn ) {
6797
- $ rootPageUid = $ this ->testingFramework ->createFrontEndPage ();
6798
- $ this ->testingFramework ->changeRecord ('pages ' , $ rootPageUid , ['slug ' => '/home ' ]);
6799
- $ this ->testingFramework ->createFakeFrontEnd ($ rootPageUid );
6800
- $ this ->testingFramework ->createAndLoginFrontEndUser ();
6801
- }
6802
-
6803
- self ::assertSame (
6804
- $ expected ,
6805
- $ subject ->canViewRegistrationsList (
6806
- $ whichPlugin ,
6807
- $ registrationsListPID ,
6808
- $ registrationsVipListPID ,
6809
- 'world '
6810
- )
6811
- );
6812
- }
6813
-
6814
6614
// Tests concerning canViewRegistrationsListMessage
6815
6615
6816
6616
/**
@@ -6855,20 +6655,6 @@ public function canViewRegistrationsListMessageForListAndNoLoginAndLoginAccessRe
6855
6655
);
6856
6656
}
6857
6657
6858
- /**
6859
- * @test
6860
- */
6861
- public function canViewRegistrationsListMessageForListAndNoLoginAndWorldAccessReturnsEmptyString (): void
6862
- {
6863
- $ subject = $ this ->createPartialMock (LegacyEvent::class, ['needsRegistration ' ]);
6864
- $ subject ->method ('needsRegistration ' )->willReturn (true );
6865
-
6866
- self ::assertSame (
6867
- '' ,
6868
- $ subject ->canViewRegistrationsListMessage ('list_registrations ' , 'world ' )
6869
- );
6870
- }
6871
-
6872
6658
/**
6873
6659
* Data provider that returns all possible access level codes for the
6874
6660
* FE registration lists.
@@ -6900,20 +6686,6 @@ public function canViewRegistrationsListMessageForVipListAndNoLoginReturnsPlease
6900
6686
);
6901
6687
}
6902
6688
6903
- /**
6904
- * @test
6905
- */
6906
- public function canViewRegistrationsListMessageForVipListAndWorldAccessAndNoLoginReturnsEmptyString (): void
6907
- {
6908
- $ subject = $ this ->createPartialMock (LegacyEvent::class, ['needsRegistration ' ]);
6909
- $ subject ->method ('needsRegistration ' )->willReturn (true );
6910
-
6911
- self ::assertSame (
6912
- '' ,
6913
- $ subject ->canViewRegistrationsListMessage ('list_vip_registrations ' , 'world ' )
6914
- );
6915
- }
6916
-
6917
6689
/**
6918
6690
* Data provider that returns all possible parameter combinations for
6919
6691
* canViewRegistrationsList as called from canViewRegistrationsListMessage.
@@ -6925,10 +6697,8 @@ public function registrationListParametersDataProvider(): array
6925
6697
return [
6926
6698
'attendeesAndManagers ' => ['list_registrations ' , 'attendees_and_managers ' ],
6927
6699
'login ' => ['list_registrations ' , 'login ' ],
6928
- 'world ' => ['list_registrations ' , 'world ' ],
6929
6700
'attendeesAndManagersVip ' => ['list_vip_registrations ' , 'attendees_and_managers ' ],
6930
6701
'loginVip ' => ['list_vip_registrations ' , 'login ' ],
6931
- 'worldVip ' => ['list_vip_registrations ' , 'world ' ],
6932
6702
];
6933
6703
}
6934
6704
0 commit comments