Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  Mitigate PHPUnit deprecations
  [TwigBundle] Add support for resetting globals between HTTP requests
  [Validator] Add Catalan and Spanish translation for `Week` constraint
  Don't use is_resource() on non-streams
  [Ldap] Fix extension deprecation
  • Loading branch information
derrabus committed Sep 8, 2024
2 parents e2d56f1 + 2a5e44d commit b6a2540
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Tests/Transport/FailoverTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public function testSendFirstWork()
public function testSendAllDead()
{
$t1 = $this->createMock(TransportInterface::class);
$t1->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
$t1->expects($this->once())->method('send')->willThrowException(new TransportException());
$t2 = $this->createMock(TransportInterface::class);
$t2->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
$t2->expects($this->once())->method('send')->willThrowException(new TransportException());
$t = new FailoverTransport([$t1, $t2]);
$this->expectException(TransportException::class);
$this->expectExceptionMessage('All transports failed.');
Expand All @@ -70,7 +70,7 @@ public function testSendAllDead()
public function testSendOneDead()
{
$t1 = $this->createMock(TransportInterface::class);
$t1->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
$t1->expects($this->once())->method('send')->willThrowException(new TransportException());
$t2 = $this->createMock(TransportInterface::class);
$t2->expects($this->exactly(3))->method('send');
$t = new FailoverTransport([$t1, $t2]);
Expand Down
12 changes: 6 additions & 6 deletions Tests/Transport/RoundRobinTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public function testSendAlternate()
public function testSendAllDead()
{
$t1 = $this->createMock(TransportInterface::class);
$t1->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
$t1->expects($this->once())->method('send')->willThrowException(new TransportException());
$t2 = $this->createMock(TransportInterface::class);
$t2->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
$t2->expects($this->once())->method('send')->willThrowException(new TransportException());
$t = new RoundRobinTransport([$t1, $t2]);
$p = new \ReflectionProperty($t, 'cursor');
$p->setValue($t, 0);
Expand All @@ -80,7 +80,7 @@ public function testSendAllDead()
public function testSendOneDead()
{
$t1 = $this->createMock(TransportInterface::class);
$t1->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
$t1->expects($this->once())->method('send')->willThrowException(new TransportException());
$t2 = $this->createMock(TransportInterface::class);
$t2->expects($this->exactly(3))->method('send');
$t = new RoundRobinTransport([$t1, $t2]);
Expand All @@ -99,7 +99,7 @@ public function testSendOneDeadAndRecoveryNotWithinRetryPeriod()
$t1 = $this->createMock(TransportInterface::class);
$t1->expects($this->exactly(4))->method('send');
$t2 = $this->createMock(TransportInterface::class);
$t2->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
$t2->expects($this->once())->method('send')->willThrowException(new TransportException());
$t = new RoundRobinTransport([$t1, $t2], 60);
$p = new \ReflectionProperty($t, 'cursor');
$p->setValue($t, 0);
Expand Down Expand Up @@ -148,13 +148,13 @@ public function testFailureDebugInformation()
$t1 = $this->createMock(TransportInterface::class);
$e1 = new TransportException();
$e1->appendDebug('Debug message 1');
$t1->expects($this->once())->method('send')->will($this->throwException($e1));
$t1->expects($this->once())->method('send')->willThrowException($e1);
$t1->expects($this->once())->method('__toString')->willReturn('t1');

$t2 = $this->createMock(TransportInterface::class);
$e2 = new TransportException();
$e2->appendDebug('Debug message 2');
$t2->expects($this->once())->method('send')->will($this->throwException($e2));
$t2->expects($this->once())->method('send')->willThrowException($e2);
$t2->expects($this->once())->method('__toString')->willReturn('t2');

$t = new RoundRobinTransport([$t1, $t2]);
Expand Down

0 comments on commit b6a2540

Please sign in to comment.