Passed
Push — master ( 2a1f3f...85aa4b )
by butschster
05:42 queued 17s
created
src/Queue/tests/Interceptor/Consume/RetryPolicyInterceptorTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
             ->with(self::class, 'bar', [])
81 81
             ->willThrowException(new TestRetryException());
82 82
 
83
-        try {
83
+        try{
84 84
             $this->interceptor->process(self::class, 'bar', [], $this->core);
85
-        } catch (RetryException $e) {
85
+        }catch (RetryException $e){
86 86
             $this->assertSame(1, $e->getOptions()->getDelay());
87 87
             $this->assertSame(['attempts' => ['1']], $e->getOptions()->getHeaders());
88 88
         }
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
                 retryPolicy: new \Spiral\Queue\RetryPolicy(maxAttempts: 2, delay: 4)
101 101
             ));
102 102
 
103
-        try {
103
+        try{
104 104
             $this->interceptor->process(self::class, 'bar', [], $this->core);
105
-        } catch (RetryException $e) {
105
+        }catch (RetryException $e){
106 106
             $this->assertSame(4, $e->getOptions()->getDelay());
107 107
             $this->assertSame(['attempts' => ['1']], $e->getOptions()->getHeaders());
108 108
         }
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
             ->with(self::class, 'bar', ['headers' => ['attempts' => ['1']]])
121 121
             ->willThrowException(new TestRetryException());
122 122
 
123
-        try {
123
+        try{
124 124
             $this->interceptor->process(
125 125
                 self::class,
126 126
                 'bar',
127 127
                 ['headers' => ['attempts' => ['1']]],
128 128
                 $this->core
129 129
             );
130
-        } catch (RetryException $e) {
130
+        }catch (RetryException $e){
131 131
             $this->assertSame(8, $e->getOptions()->getDelay());
132 132
             $this->assertSame(['attempts' => ['2']], $e->getOptions()->getHeaders());
133 133
         }
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
                 retryPolicy: new \Spiral\Queue\RetryPolicy(maxAttempts: 3, delay: 4, multiplier: 2)
148 148
             ));
149 149
 
150
-        try {
150
+        try{
151 151
             $this->interceptor->process(
152 152
                 self::class,
153 153
                 'bar',
154 154
                 ['headers' => ['attempts' => ['1']]],
155 155
                 $this->core
156 156
             );
157
-        } catch (RetryException $e) {
157
+        }catch (RetryException $e){
158 158
             $this->assertSame(8, $e->getOptions()->getDelay());
159 159
             $this->assertSame(['attempts' => ['2']], $e->getOptions()->getHeaders());
160 160
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             ->method('callAction')
172 172
             ->with(self::class, 'bar', ['headers' => ['attempts' => ['1']]])
173 173
             ->willThrowException(new TestRetryException(
174
-                retryPolicy: new class implements RetryPolicyInterface {
174
+                retryPolicy: new class implements RetryPolicyInterface{
175 175
                     public function isRetryable(\Throwable $exception, int $attempts = 0): bool
176 176
                     {
177 177
                         return true;
@@ -184,14 +184,14 @@  discard block
 block discarded – undo
184 184
                 }
185 185
             ));
186 186
 
187
-        try {
187
+        try{
188 188
             $this->interceptor->process(
189 189
                 self::class,
190 190
                 'bar',
191 191
                 ['headers' => ['attempts' => ['1']]],
192 192
                 $this->core
193 193
             );
194
-        } catch (RetryException $e) {
194
+        }catch (RetryException $e){
195 195
             $this->assertSame(5, $e->getOptions()->getDelay());
196 196
             $this->assertSame(['attempts' => ['2']], $e->getOptions()->getHeaders());
197 197
         }
@@ -213,14 +213,14 @@  discard block
 block discarded – undo
213 213
                 )
214 214
             ));
215 215
 
216
-        try {
216
+        try{
217 217
             $this->interceptor->process(
218 218
                 self::class,
219 219
                 'bar',
220 220
                 ['headers' => ['attempts' => ['1']]],
221 221
                 $this->core
222 222
             );
223
-        } catch (RetryException $e) {
223
+        }catch (RetryException $e){
224 224
             $this->assertSame(8, $e->getOptions()->getDelay());
225 225
             $this->assertSame(['attempts' => ['2']], $e->getOptions()->getHeaders());
226 226
         }
Please login to merge, or discard this patch.