@@ -48,9 +48,10 @@ public function getLastNotificationId(): array {
48
48
}
49
49
50
50
/**
51
- * @AfterScenario
51
+ * delete de-provisioning notification
52
52
*
53
53
* @return void
54
+ * @throws GuzzleException
54
55
*/
55
56
public function deleteDeprovisioningNotification (): void {
56
57
$ payload ["ids " ] = ["deprovision " ];
@@ -66,6 +67,41 @@ public function deleteDeprovisioningNotification(): void {
66
67
);
67
68
}
68
69
70
+ /**
71
+ * Delete all the inbucket emails
72
+ *
73
+ * @return void
74
+ * @throws GuzzleException
75
+ */
76
+ public function clearInbucketMessages (): void {
77
+ try {
78
+ $ usersList = $ this ->featureContext ->getAllCreatedUsers ();
79
+ foreach ($ usersList as $ emailRecipient ) {
80
+ EmailHelper::deleteAllEmailsForAMailbox (
81
+ EmailHelper::getLocalEmailUrl (),
82
+ $ this ->featureContext ->getStepLineRef (),
83
+ $ emailRecipient ['email ' ]
84
+ );
85
+ }
86
+ } catch (Exception $ e ) {
87
+ echo __METHOD__ .
88
+ " could not delete inbucket messages, is inbucket set up? \n" .
89
+ $ e ->getMessage ();
90
+ }
91
+ }
92
+
93
+ /**
94
+ * @AfterScenario
95
+ *
96
+ * @return void
97
+ * @throws GuzzleException
98
+ * @throws JsonException
99
+ */
100
+ public function deleteAllNotifications (): void {
101
+ $ this ->deleteDeprovisioningNotification ();
102
+ $ this ->clearInbucketMessages ();
103
+ }
104
+
69
105
/**
70
106
* @var string
71
107
*/
@@ -151,7 +187,7 @@ public function userListAllNotifications(string $user): void {
151
187
* @throws GuzzleException
152
188
* @throws JsonException
153
189
*/
154
- public function deleteAllNotifications (string $ user ): ResponseInterface {
190
+ public function deleteAllInAppNotifications (string $ user ): ResponseInterface {
155
191
$ response = $ this ->listAllNotifications ($ user );
156
192
if (isset ($ this ->featureContext ->getJsonDecodedResponseBodyContent ($ response )->ocs ->data )) {
157
193
$ responseBody = $ this ->featureContext ->getJsonDecodedResponseBodyContent ($ response )->ocs ->data ;
@@ -173,7 +209,7 @@ public function deleteAllNotifications(string $user): ResponseInterface {
173
209
* @throws JsonException
174
210
*/
175
211
public function userDeletesAllNotifications (string $ user ): void {
176
- $ response = $ this ->deleteAllNotifications ($ user );
212
+ $ response = $ this ->deleteAllInAppNotifications ($ user );
177
213
$ this ->featureContext ->setResponse ($ response );
178
214
}
179
215
@@ -187,7 +223,7 @@ public function userDeletesAllNotifications(string $user): void {
187
223
* @throws JsonException
188
224
*/
189
225
public function userHasDeletedAllNotifications (string $ user ): void {
190
- $ response = $ this ->deleteAllNotifications ($ user );
226
+ $ response = $ this ->deleteAllInAppNotifications ($ user );
191
227
$ this ->featureContext ->theHTTPStatusCodeShouldBe (200 , "" , $ response );
192
228
}
193
229
@@ -661,30 +697,6 @@ public function assertEmailContains(
661
697
);
662
698
}
663
699
664
- /**
665
- * Delete all the inbucket emails
666
- *
667
- * @AfterScenario @email
668
- *
669
- * @return void
670
- */
671
- public function clearInbucketMessages (): void {
672
- try {
673
- $ usersList = $ this ->featureContext ->getAllCreatedUsers ();
674
- foreach ($ usersList as $ emailRecipient ) {
675
- EmailHelper::deleteAllEmailsForAMailbox (
676
- EmailHelper::getLocalEmailUrl (),
677
- $ this ->featureContext ->getStepLineRef (),
678
- $ emailRecipient ['email ' ]
679
- );
680
- }
681
- } catch (Exception $ e ) {
682
- echo __METHOD__ .
683
- " could not delete inbucket messages, is inbucket set up? \n" .
684
- $ e ->getMessage ();
685
- }
686
- }
687
-
688
700
/**
689
701
*
690
702
* @param string|null $user
0 commit comments