@@ -72,14 +72,10 @@ protected function setUp(): void
72
72
*/
73
73
public function testValidateCorrectComposerJson (): void
74
74
{
75
- $ this ->magentoVersionMock ->expects ($ this ->once ())
76
- ->method ('isGreaterOrEqual ' )
77
- ->with ('2.3 ' )
78
- ->willReturn (true );
79
- $ this ->magentoVersionMock ->expects ($ this ->once ())
75
+ $ this ->magentoVersionMock ->expects ($ this ->exactly (2 ))
80
76
->method ('isGreaterOrEqual ' )
81
- ->with ( '2.4.3 ' )
82
- ->willReturn ( false );
77
+ ->withConsecutive ([ '2.3 ' ], [ ' 2. 4.3 '] )
78
+ ->willReturnOnConsecutiveCalls ( true , false );
83
79
$ this ->fileListMock ->expects ($ this ->once ())
84
80
->method ('getMagentoComposer ' )
85
81
->willReturn (__DIR__ . '/_files/correct_composer_2.3.json ' );
@@ -94,14 +90,10 @@ public function testValidateCorrectComposerJson(): void
94
90
*/
95
91
public function testValidateCorrectLaminasComposerJson (): void
96
92
{
97
- $ this ->magentoVersionMock ->expects ($ this ->once ())
98
- ->method ('isGreaterOrEqual ' )
99
- ->with ('2.3 ' )
100
- ->willReturn (true );
101
- $ this ->magentoVersionMock ->expects ($ this ->once ())
93
+ $ this ->magentoVersionMock ->expects ($ this ->exactly (2 ))
102
94
->method ('isGreaterOrEqual ' )
103
- ->with ( '2.4.3 ' )
104
- ->willReturn ( false );
95
+ ->withConsecutive ([ '2.3 ' ], [ ' 2. 4.3 '] )
96
+ ->willReturnOnConsecutiveCalls ( true , false );
105
97
$ this ->fileListMock ->expects ($ this ->once ())
106
98
->method ('getMagentoComposer ' )
107
99
->willReturn (__DIR__ . '/_files/correct_composer_2.3_2.json ' );
@@ -116,14 +108,10 @@ public function testValidateCorrectLaminasComposerJson(): void
116
108
*/
117
109
public function testValidateCorrectAutoload243ComposerJson (): void
118
110
{
119
- $ this ->magentoVersionMock ->expects ($ this ->once ( ))
111
+ $ this ->magentoVersionMock ->expects ($ this ->exactly ( 2 ))
120
112
->method ('isGreaterOrEqual ' )
121
- ->with ('2.3 ' )
122
- ->willReturn (true );
123
- $ this ->magentoVersionMock ->expects ($ this ->once ())
124
- ->method ('isGreaterOrEqual ' )
125
- ->with ('2.4.3 ' )
126
- ->willReturn (false );
113
+ ->withConsecutive (['2.3 ' ], ['2.4.3 ' ])
114
+ ->willReturnOnConsecutiveCalls (true , false );
127
115
$ this ->fileListMock ->expects ($ this ->once ())
128
116
->method ('getMagentoComposer ' )
129
117
->willReturn (__DIR__ . '/_files/correct_composer_2.3_2.json ' );
@@ -138,14 +126,10 @@ public function testValidateCorrectAutoload243ComposerJson(): void
138
126
*/
139
127
public function testValidateWrongComposerJson (): void
140
128
{
141
- $ this ->magentoVersionMock ->expects ($ this ->once ( ))
129
+ $ this ->magentoVersionMock ->expects ($ this ->exactly ( 2 ))
142
130
->method ('isGreaterOrEqual ' )
143
- ->with ('2.3 ' )
144
- ->willReturn (true );
145
- $ this ->magentoVersionMock ->expects ($ this ->once ())
146
- ->method ('isGreaterOrEqual ' )
147
- ->with ('2.4.3 ' )
148
- ->willReturn (false );
131
+ ->withConsecutive (['2.3 ' ], ['2.4.3 ' ])
132
+ ->willReturnOnConsecutiveCalls (true , false );
149
133
$ this ->fileListMock ->expects ($ this ->once ())
150
134
->method ('getMagentoComposer ' )
151
135
->willReturn (__DIR__ . '/_files/wrong_composer_2.3.json ' );
@@ -171,14 +155,10 @@ public function testValidateWrongComposerJson(): void
171
155
*/
172
156
public function testValidateMagentoLower23 (): void
173
157
{
174
- $ this ->magentoVersionMock ->expects ($ this ->once ( ))
158
+ $ this ->magentoVersionMock ->expects ($ this ->exactly ( 1 ))
175
159
->method ('isGreaterOrEqual ' )
176
- ->with ('2.3 ' )
177
- ->willReturn (false );
178
- $ this ->magentoVersionMock ->expects ($ this ->once ())
179
- ->method ('isGreaterOrEqual ' )
180
- ->with ('2.4.3 ' )
181
- ->willReturn (false );
160
+ ->withConsecutive (['2.3 ' ])
161
+ ->willReturnOnConsecutiveCalls (false );
182
162
$ this ->fileListMock ->expects ($ this ->never ())
183
163
->method ('getMagentoComposer ' );
184
164
$ this ->resultFactoryMock ->expects ($ this ->once ())
@@ -192,14 +172,10 @@ public function testValidateMagentoLower23(): void
192
172
*/
193
173
public function testValidateMagentoHigherEqual243 (): void
194
174
{
195
- $ this ->magentoVersionMock ->expects ($ this ->once ( ))
175
+ $ this ->magentoVersionMock ->expects ($ this ->exactly ( 1 ))
196
176
->method ('isGreaterOrEqual ' )
197
- ->with ('2.3 ' )
198
- ->willReturn (false );
199
- $ this ->magentoVersionMock ->expects ($ this ->once ())
200
- ->method ('isGreaterOrEqual ' )
201
- ->with ('2.4.3 ' )
202
- ->willReturn (false );
177
+ ->withConsecutive (['2.3 ' ])
178
+ ->willReturnOnConsecutiveCalls (false );
203
179
$ this ->fileListMock ->expects ($ this ->never ())
204
180
->method ('getMagentoComposer ' );
205
181
$ this ->resultFactoryMock ->expects ($ this ->once ())
@@ -213,14 +189,10 @@ public function testValidateMagentoHigherEqual243(): void
213
189
*/
214
190
public function testValidateComposerFileNotExists (): void
215
191
{
216
- $ this ->magentoVersionMock ->expects ($ this ->once ())
217
- ->method ('isGreaterOrEqual ' )
218
- ->with ('2.3 ' )
219
- ->willReturn (true );
220
- $ this ->magentoVersionMock ->expects ($ this ->once ())
192
+ $ this ->magentoVersionMock ->expects ($ this ->exactly (2 ))
221
193
->method ('isGreaterOrEqual ' )
222
- ->with ( '2.4.3 ' )
223
- ->willReturn (true );
194
+ ->withConsecutive ([ '2.3 ' ], [ ' 2. 4.3 '] )
195
+ ->willReturnOnConsecutiveCalls (true , false );
224
196
$ this ->fileListMock ->expects ($ this ->once ())
225
197
->method ('getMagentoComposer ' )
226
198
->willReturn (__DIR__ . '/_files/file_not_exists.json ' );
0 commit comments