Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita6c5279

Browse files
Merge branch '7.4' into 8.0
* 7.4: Fix merge CS fix
2 parents9e610ca +97f1c2b commita6c5279

File tree

3 files changed

+47
-22
lines changed

3 files changed

+47
-22
lines changed

‎src/Symfony/Component/Messenger/Command/StatsCommand.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9494
}
9595

9696
match ($format) {
97-
'txt' =>$this->outputText($io,$outputTable,$uncountableTransports),
97+
'txt' =>$this->outputText($io,$errorIo,$outputTable,$uncountableTransports),
9898
'json' =>$this->outputJson($io,$outputTable,$uncountableTransports),
9999
};
100100

101101
return0;
102102
}
103103

104-
privatefunctionoutputText(SymfonyStyle$io,array$outputTable,array$uncountableTransports):void
104+
privatefunctionoutputText(SymfonyStyle$io,SymfonyStyle$errorIo,array$outputTable,array$uncountableTransports):void
105105
{
106106
$io->table(['Transport','Count'],$outputTable);
107107

‎src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php‎

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -309,21 +309,23 @@ public function testSuccessMessageGoesToStdout()
309309
$receiver =$this->createMock(ReceiverInterface::class);
310310
$receiver->expects($this->once())->method('get')->willReturn([$envelope]);
311311

312-
$receiverLocator =$this->createMock(ContainerInterface::class);
313-
$receiverLocator->expects($this->once())->method('has')->with('dummy-receiver')->willReturn(true);
314-
$receiverLocator->expects($this->once())->method('get')->with('dummy-receiver')->willReturn($receiver);
312+
$receiverLocator =newContainer();
313+
$receiverLocator->set('dummy-receiver',$receiver);
315314

316315
$bus =$this->createMock(MessageBusInterface::class);
317316
$bus->expects($this->once())->method('dispatch');
318317

319-
$busLocator =$this->createMock(ContainerInterface::class);
320-
$busLocator->expects($this->once())->method('has')->with('dummy-bus')->willReturn(true);
321-
$busLocator->expects($this->once())->method('get')->with('dummy-bus')->willReturn($bus);
318+
$busLocator =newContainer();
319+
$busLocator->set('dummy-bus',$bus);
322320

323321
$command =newConsumeMessagesCommand(newRoutableMessageBus($busLocator),$receiverLocator,newEventDispatcher());
324322

325323
$application =newApplication();
326-
$application->add($command);
324+
if (method_exists($application,'addCommand')) {
325+
$application->addCommand($command);
326+
}else {
327+
$application->add($command);
328+
}
327329
$tester =newCommandTester($application->get('messenger:consume'));
328330
$tester->execute([
329331
'receivers' => ['dummy-receiver'],
@@ -344,21 +346,23 @@ public function testCommentsGoToStderr()
344346
$receiver =$this->createMock(ReceiverInterface::class);
345347
$receiver->expects($this->once())->method('get')->willReturn([$envelope]);
346348

347-
$receiverLocator =$this->createMock(ContainerInterface::class);
348-
$receiverLocator->expects($this->once())->method('has')->with('dummy-receiver')->willReturn(true);
349-
$receiverLocator->expects($this->once())->method('get')->with('dummy-receiver')->willReturn($receiver);
349+
$receiverLocator =newContainer();
350+
$receiverLocator->set('dummy-receiver',$receiver);
350351

351352
$bus =$this->createMock(MessageBusInterface::class);
352353
$bus->expects($this->once())->method('dispatch');
353354

354-
$busLocator =$this->createMock(ContainerInterface::class);
355-
$busLocator->expects($this->once())->method('has')->with('dummy-bus')->willReturn(true);
356-
$busLocator->expects($this->once())->method('get')->with('dummy-bus')->willReturn($bus);
355+
$busLocator =newContainer();
356+
$busLocator->set('dummy-bus',$bus);
357357

358358
$command =newConsumeMessagesCommand(newRoutableMessageBus($busLocator),$receiverLocator,newEventDispatcher());
359359

360360
$application =newApplication();
361-
$application->add($command);
361+
if (method_exists($application,'addCommand')) {
362+
$application->addCommand($command);
363+
}else {
364+
$application->add($command);
365+
}
362366
$tester =newCommandTester($application->get('messenger:consume'));
363367
$tester->execute([
364368
'receivers' => ['dummy-receiver'],

‎src/Symfony/Component/Messenger/Tests/Command/FailedMessagesShowCommandTest.php‎

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,12 +491,33 @@ public function testTableOutputGoesToStdout()
491491
publicfunctiontestPendingMessageCountGoesToStdout()
492492
{
493493
$receiver =newclassimplements ListableReceiverInterface, MessageCountAwareInterface {
494-
publicfunctionget():iterable {return []; }
495-
publicfunctionack(Envelope$envelope):void {}
496-
publicfunctionreject(Envelope$envelope):void {}
497-
publicfunctionfind(mixed$id): ?Envelope {returnnull; }
498-
publicfunctionall(int$limit =null):iterable {return []; }
499-
publicfunctiongetMessageCount():int {return3; }
494+
publicfunctionget():iterable
495+
{
496+
return [];
497+
}
498+
499+
publicfunctionack(Envelope$envelope):void
500+
{
501+
}
502+
503+
publicfunctionreject(Envelope$envelope):void
504+
{
505+
}
506+
507+
publicfunctionfind(mixed$id): ?Envelope
508+
{
509+
returnnull;
510+
}
511+
512+
publicfunctionall(?int$limit =null):iterable
513+
{
514+
return [];
515+
}
516+
517+
publicfunctiongetMessageCount():int
518+
{
519+
return3;
520+
}
500521
};
501522

502523
$serviceLocator =$this->createMock(ServiceLocator::class);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp