Skip to content

Commit e85ef24

Browse files
Merge branch '5.4' into 6.2
* 5.4: [Tests] Remove occurrences of `withConsecutive()` Fix support binary values in parameters. [Dotenv] Improve Dotenv::usePutenv phpdoc
2 parents 2522b7f + 4cc8645 commit e85ef24

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

Tests/Console/ApplicationTest.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,31 @@ private function getKernel(array $bundles, $useDispatcher = false)
258258
$container
259259
->expects($this->exactly(2))
260260
->method('hasParameter')
261-
->withConsecutive(['console.command.ids'], ['console.lazy_command.ids'])
262-
->willReturnOnConsecutiveCalls(true, true)
261+
->willReturnCallback(function (...$args) {
262+
static $series = [
263+
['console.command.ids'],
264+
['console.lazy_command.ids'],
265+
];
266+
267+
$this->assertSame(array_shift($series), $args);
268+
269+
return true;
270+
})
263271
;
272+
264273
$container
265274
->expects($this->exactly(2))
266275
->method('getParameter')
267-
->withConsecutive(['console.lazy_command.ids'], ['console.command.ids'])
268-
->willReturnOnConsecutiveCalls([], [])
276+
->willReturnCallback(function (...$args) {
277+
static $series = [
278+
['console.lazy_command.ids'],
279+
['console.command.ids'],
280+
];
281+
282+
$this->assertSame(array_shift($series), $args);
283+
284+
return [];
285+
})
269286
;
270287

271288
$kernel = $this->createMock(KernelInterface::class);

Tests/Translation/TranslatorTest.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,21 @@ public function testResourceFilesOptionLoadsBeforeOtherAddedResources($debug, $e
149149

150150
$loader = $this->createMock(LoaderInterface::class);
151151

152+
$series = [
153+
/* The "messages.some_locale.loader" is passed via the resource_file option and shall be loaded first */
154+
[['messages.some_locale.loader', 'some_locale', 'messages'], $someCatalogue],
155+
/* This resource is added by an addResource() call and shall be loaded after the resource_files */
156+
[['second_resource.some_locale.loader', 'some_locale', 'messages'], $someCatalogue],
157+
];
158+
152159
$loader->expects($this->exactly(2))
153160
->method('load')
154-
->withConsecutive(
155-
/* The "messages.some_locale.loader" is passed via the resource_file option and shall be loaded first */
156-
['messages.some_locale.loader', 'some_locale', 'messages'],
157-
/* This resource is added by an addResource() call and shall be loaded after the resource_files */
158-
['second_resource.some_locale.loader', 'some_locale', 'messages']
159-
)
160-
->willReturnOnConsecutiveCalls(
161-
$someCatalogue,
162-
$someCatalogue
163-
);
161+
->willReturnCallback(function (...$args) use (&$series) {
162+
[$expectedArgs, $return] = array_shift($series);
163+
$this->assertSame($expectedArgs, $args);
164+
165+
return $return;
166+
});
164167

165168
$options = [
166169
'resource_files' => ['some_locale' => ['messages.some_locale.loader']],

0 commit comments

Comments
 (0)