Skip to content

Commit 13253a2

Browse files
authored
Merge pull request #161 from magento-gl/Arrows_Delivery_07162024
[Arrows] Delivery of PHPUnit 10 Deprecations
2 parents 88d036c + 7afaabf commit 13253a2

File tree

15 files changed

+42
-39
lines changed

15 files changed

+42
-39
lines changed

ReCaptchaCheckout/Test/Unit/Block/LayoutProcessor/Checkout/OnepageTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function testProcess(array $mocks, array $expected): void
119119
$this->assertSame($expected, $actual);
120120
}
121121

122-
public function processDataProvider(): array
122+
public static function processDataProvider(): array
123123
{
124124
return [
125125
[

ReCaptchaPaypal/Test/Unit/Block/LayoutProcessor/Checkout/OnepageTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testProcess(array $mocks, array $expected): void
107107
/**
108108
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
109109
*/
110-
public function processDataProvider(): array
110+
public static function processDataProvider(): array
111111
{
112112
return [
113113
[

ReCaptchaPaypal/Test/Unit/Observer/PayPalObserverTest.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function testExecute(array $mocks): void
114114
$this->model->execute($this->observer);
115115
}
116116

117-
public function executeDataProvider(): array
117+
public static function executeDataProvider(): array
118118
{
119119
return [
120120
[
@@ -131,7 +131,7 @@ public function executeDataProvider(): array
131131
'reCaptchaSession' => [
132132
[
133133
'method' => 'save',
134-
'expects' => $this->never(),
134+
'expects' => self::never(),
135135
]
136136
]
137137
]
@@ -150,20 +150,20 @@ public function executeDataProvider(): array
150150
'reCaptchaSession' => [
151151
[
152152
'method' => 'save',
153-
'expects' => $this->never(),
153+
'expects' => self::never(),
154154
]
155155
],
156156
'captchaValidator' => [
157157
[
158158
'method' => 'isValid',
159-
'expects' => $this->once(),
159+
'expects' => self::once(),
160160
'willReturnProperty' => 'validationResult'
161161
]
162162
],
163163
'validationResult' => [
164164
[
165165
'method' => 'isValid',
166-
'expects' => $this->once(),
166+
'expects' => self::once(),
167167
'willReturn' => true,
168168
]
169169
]
@@ -183,20 +183,20 @@ public function executeDataProvider(): array
183183
'reCaptchaSession' => [
184184
[
185185
'method' => 'save',
186-
'expects' => $this->once(),
186+
'expects' => self::once(),
187187
]
188188
],
189189
'captchaValidator' => [
190190
[
191191
'method' => 'isValid',
192-
'expects' => $this->once(),
192+
'expects' => self::once(),
193193
'willReturnProperty' => 'validationResult'
194194
]
195195
],
196196
'validationResult' => [
197197
[
198198
'method' => 'isValid',
199-
'expects' => $this->once(),
199+
'expects' => self::once(),
200200
'willReturn' => true,
201201
]
202202
]

ReCaptchaPaypal/Test/Unit/Plugin/ReplayPayflowReCaptchaForPlaceOrderTest.php

+18-18
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ public function testAfterGetConfigFor(array $mocks, bool $isResultNull, bool $is
9696
/**
9797
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
9898
*/
99-
public function afterGetConfigForDataProvider(): array
99+
public static function afterGetConfigForDataProvider(): array
100100
{
101101
return [
102102
[
103103
[
104104
'reCaptchaSession' => [
105-
['method' => 'isValid', 'expects' => $this->never()]
105+
['method' => 'isValid', 'expects' => self::never()]
106106
]
107107
],
108108
true,
@@ -114,7 +114,7 @@ public function afterGetConfigForDataProvider(): array
114114
['method' => 'isCaptchaEnabledFor', 'with' => 'paypal_payflowpro', 'willReturn' => false]
115115
],
116116
'reCaptchaSession' => [
117-
['method' => 'isValid', 'expects' => $this->never(),]
117+
['method' => 'isValid', 'expects' => self::never(),]
118118
]
119119
],
120120
false,
@@ -126,10 +126,10 @@ public function afterGetConfigForDataProvider(): array
126126
['method' => 'isCaptchaEnabledFor', 'with' => 'paypal_payflowpro', 'willReturn' => true]
127127
],
128128
'request' => [
129-
['method' => 'getBodyParams', 'expects' => $this->once(), 'willReturn' => []]
129+
['method' => 'getBodyParams', 'expects' => self::once(), 'willReturn' => []]
130130
],
131131
'reCaptchaSession' => [
132-
['method' => 'isValid', 'expects' => $this->never(),]
132+
['method' => 'isValid', 'expects' => self::never(),]
133133
]
134134
],
135135
false,
@@ -143,12 +143,12 @@ public function afterGetConfigForDataProvider(): array
143143
'request' => [
144144
[
145145
'method' => 'getBodyParams',
146-
'expects' => $this->once(),
146+
'expects' => self::once(),
147147
'willReturn' => ['cartId' => 1, 'paymentMethod' => ['method' => 'checkmo']]
148148
]
149149
],
150150
'reCaptchaSession' => [
151-
['method' => 'isValid', 'expects' => $this->never(), 'willReturn' => false]
151+
['method' => 'isValid', 'expects' => self::never(), 'willReturn' => false]
152152
]
153153
],
154154
false,
@@ -162,12 +162,12 @@ public function afterGetConfigForDataProvider(): array
162162
'request' => [
163163
[
164164
'method' => 'getBodyParams',
165-
'expects' => $this->once(),
165+
'expects' => self::once(),
166166
'willReturn' => ['cartId' => 1, 'paymentMethod' => ['method' => Config::METHOD_PAYFLOWPRO]]
167167
]
168168
],
169169
'reCaptchaSession' => [
170-
['method' => 'isValid', 'expects' => $this->once(), 'with' => 1, 'willReturn' => false]
170+
['method' => 'isValid', 'expects' => self::once(), 'with' => 1, 'willReturn' => false]
171171
]
172172
],
173173
false,
@@ -181,12 +181,12 @@ public function afterGetConfigForDataProvider(): array
181181
'request' => [
182182
[
183183
'method' => 'getBodyParams',
184-
'expects' => $this->once(),
184+
'expects' => self::once(),
185185
'willReturn' => ['cartId' => 1, 'paymentMethod' => ['method' => Config::METHOD_PAYFLOWPRO]]
186186
]
187187
],
188188
'reCaptchaSession' => [
189-
['method' => 'isValid', 'expects' => $this->once(), 'with' => 1, 'willReturn' => true]
189+
['method' => 'isValid', 'expects' => self::once(), 'with' => 1, 'willReturn' => true]
190190
]
191191
],
192192
false,
@@ -200,15 +200,15 @@ public function afterGetConfigForDataProvider(): array
200200
'request' => [
201201
[
202202
'method' => 'getBodyParams',
203-
'expects' => $this->once(),
203+
'expects' => self::once(),
204204
'willReturn' => [
205205
'cart_id' => 1,
206206
'payment_method' => ['method' => Config::METHOD_PAYFLOWPRO]
207207
]
208208
]
209209
],
210210
'reCaptchaSession' => [
211-
['method' => 'isValid', 'expects' => $this->once(), 'with' => 1, 'willReturn' => true]
211+
['method' => 'isValid', 'expects' => self::once(), 'with' => 1, 'willReturn' => true]
212212
]
213213
],
214214
false,
@@ -222,7 +222,7 @@ public function afterGetConfigForDataProvider(): array
222222
'request' => [
223223
[
224224
'method' => 'getBodyParams',
225-
'expects' => $this->once(),
225+
'expects' => self::once(),
226226
'willReturn' => [
227227
'cartId' => '17uc43rge98nc92',
228228
'paymentMethod' => ['method' => Config::METHOD_PAYFLOWPRO]
@@ -232,24 +232,24 @@ public function afterGetConfigForDataProvider(): array
232232
'quoteIdMaskFactory' => [
233233
[
234234
'method' => 'create',
235-
'expects' => $this->once(),
235+
'expects' => self::once(),
236236
'willReturnProperty' => 'quoteIdMask'
237237
]
238238
],
239239
'quoteIdMask' => [
240240
[
241241
'method' => 'load',
242-
'expects' => $this->once(),
242+
'expects' => self::once(),
243243
'willReturnSelf' => null
244244
],
245245
[
246246
'method' => 'getQuoteId',
247-
'expects' => $this->once(),
247+
'expects' => self::once(),
248248
'willReturn' => 2
249249
]
250250
],
251251
'reCaptchaSession' => [
252-
['method' => 'isValid', 'expects' => $this->once(), 'with' => 2, 'willReturn' => true]
252+
['method' => 'isValid', 'expects' => self::once(), 'with' => 2, 'willReturn' => true]
253253
]
254254
],
255255
false,

ReCaptchaReview/Test/Api/GraphQl/Review/ProductReviewsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testAddProductReviewReCaptchaValidationFailed(string $customerNa
7070
/**
7171
* @return array
7272
*/
73-
public function customerDataProvider(): array
73+
public static function customerDataProvider(): array
7474
{
7575
return [
7676
'Guest' => ['John Doe', true],

ReCaptchaWebapiGraphQl/Test/Unit/Plugin/GraphQlValidatorTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
use PHPUnit\Framework\TestCase;
2424
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
2525

26+
/**
27+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
28+
*/
2629
class GraphQlValidatorTest extends TestCase
2730
{
2831
/**
@@ -60,7 +63,7 @@ protected function setUp(): void
6063
);
6164
}
6265

63-
public function getPluginCases(): array
66+
public static function getPluginCases(): array
6467
{
6568
return [
6669
'not-mutation' => [false, true, false, false],

ReCaptchaWebapiGraphQl/Test/Unit/Plugin/ValidationOverriderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function setUp(): void
3535
$this->model = new ValidationOverrider($this->userContextMock);
3636
}
3737

38-
public function getUserContextData(): array
38+
public static function getUserContextData(): array
3939
{
4040
return [
4141
'customer' => [UserContextInterface::USER_TYPE_CUSTOMER, 1, true],

ReCaptchaWebapiRest/Test/Unit/Plugin/RestValidationPluginTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function setUp(): void
7171
);
7272
}
7373

74-
public function getPluginCases(): array
74+
public static function getPluginCases(): array
7575
{
7676
return [
7777
'unprotected-endpoint' => [false, false, false],

ReCaptchaWebapiRest/Test/Unit/Plugin/SoapValidationPluginTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function setUp(): void
6464
);
6565
}
6666

67-
public function getPluginCases(): array
67+
public static function getPluginCases(): array
6868
{
6969
return [
7070
'not-protected' => [false, UserContextInterface::USER_TYPE_GUEST, null, false],

ReCaptchaWebapiRest/Test/Unit/Plugin/ValidationOverriderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function setUp(): void
3535
$this->model = new ValidationOverrider($this->userContextMock);
3636
}
3737

38-
public function getUserContextData(): array
38+
public static function getUserContextData(): array
3939
{
4040
return [
4141
'customer' => [UserContextInterface::USER_TYPE_CUSTOMER, 1, true],

TwoFactorAuth/Test/Unit/Model/Config/Backend/Duo/ApiHostnameTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testBefore($value, $isValid): void
4040
$this->model->beforeSave();
4141
}
4242

43-
public function valuesDataProvider()
43+
public static function valuesDataProvider()
4444
{
4545
return [
4646
['', true],

TwoFactorAuth/Test/Unit/Model/Provider/Engine/AuthyTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function setUp(): void
4040
*
4141
* @return array
4242
*/
43-
public function getIsEnabledTestDataSet(): array
43+
public static function getIsEnabledTestDataSet(): array
4444
{
4545
return [
4646
'api key present' => [

TwoFactorAuth/Test/Unit/Model/Provider/Engine/DuoSecurityTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function setUp(): void
5555
*
5656
* @return array
5757
*/
58-
public function getIsEnabledTestDataSet(): array
58+
public static function getIsEnabledTestDataSet(): array
5959
{
6060
return [
6161
[

TwoFactorAuth/Test/Unit/Model/TfaTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function testAllEnabledProvidersUpdates(): void
142142
*
143143
* @return array
144144
*/
145-
public function getForcedProvidersDataSet(): array
145+
public static function getForcedProvidersDataSet(): array
146146
{
147147
return [
148148
'not defined' => [

TwoFactorAuth/Test/Unit/Model/UserConfig/HtmlAreaTokenVerifierTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected function setUp(): void
9595
*
9696
* @return array
9797
*/
98-
public function getTokenRequestData(): array
98+
public static function getTokenRequestData(): array
9999
{
100100
return [
101101
'token in query' => [

0 commit comments

Comments
 (0)