@@ -65,7 +65,7 @@ public function testJsonSerializeStrangeFilters(): void
6565 );
6666 }
6767
68- public function testPhaseJobSubscription (): void
68+ public function testPhaseJobFailedSubscription (): void
6969 {
7070 $ subscriptionRequest = new Subscription (
7171 'phase-job-failed ' ,
@@ -101,4 +101,78 @@ public function testPhaseJobSubscription(): void
101101 $ subscriptionRequest ->jsonSerialize ()
102102 );
103103 }
104+
105+ public function testPhaseJobSucceededWithWarningSubscription (): void
106+ {
107+ $ subscriptionRequest = new Subscription (
108+ 'phase-job-succeeded-with-warning ' ,
109+ new EmailRecipient ('john.doe@example.com ' ),
110+ [
111+ new Filter ('job.component.id ' , 'my.component ' ),
112+ new Filter ('job.configuration.id ' , '12345 ' ),
113+ new Filter ('phase.id ' , '123 ' ),
114+ ]
115+ );
116+ self ::assertSame (
117+ [
118+ 'event ' => 'phase-job-succeeded-with-warning ' ,
119+ 'filters ' => [
120+ [
121+ 'field ' => 'job.component.id ' ,
122+ 'value ' => 'my.component ' ,
123+ ],
124+ [
125+ 'field ' => 'job.configuration.id ' ,
126+ 'value ' => '12345 ' ,
127+ ],
128+ [
129+ 'field ' => 'phase.id ' ,
130+ 'value ' => '123 ' ,
131+ ],
132+ ],
133+ 'recipient ' => [
134+ 'channel ' => 'email ' ,
135+ 'address ' => 'john.doe@example.com ' ,
136+ ],
137+ ],
138+ $ subscriptionRequest ->jsonSerialize ()
139+ );
140+ }
141+
142+ public function testPhaseJobProcessingLongSubscription (): void
143+ {
144+ $ subscriptionRequest = new Subscription (
145+ 'phase-job-processing-long ' ,
146+ new EmailRecipient ('john.doe@example.com ' ),
147+ [
148+ new Filter ('job.component.id ' , 'my.component ' ),
149+ new Filter ('job.configuration.id ' , '12345 ' ),
150+ new Filter ('phase.id ' , '123 ' ),
151+ ]
152+ );
153+ self ::assertSame (
154+ [
155+ 'event ' => 'phase-job-processing-long ' ,
156+ 'filters ' => [
157+ [
158+ 'field ' => 'job.component.id ' ,
159+ 'value ' => 'my.component ' ,
160+ ],
161+ [
162+ 'field ' => 'job.configuration.id ' ,
163+ 'value ' => '12345 ' ,
164+ ],
165+ [
166+ 'field ' => 'phase.id ' ,
167+ 'value ' => '123 ' ,
168+ ],
169+ ],
170+ 'recipient ' => [
171+ 'channel ' => 'email ' ,
172+ 'address ' => 'john.doe@example.com ' ,
173+ ],
174+ ],
175+ $ subscriptionRequest ->jsonSerialize ()
176+ );
177+ }
104178}
0 commit comments