Skip to content

Commit bbf2146

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: Mitigate PHPUnit deprecations [TwigBundle] Add support for resetting globals between HTTP requests Mitigate PHPUnit deprecations [Cache] Fix compatibility with Redis 6.1.0 pre-releases [Validator] Add Catalan and Spanish translation for `Week` constraint Don't use is_resource() on non-streams [Ldap] Fix extension deprecation
2 parents 8fcff0a + b6a2540 commit bbf2146

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Tests/Transport/FailoverTransportTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ public function testSendFirstWork()
5757
public function testSendAllDead()
5858
{
5959
$t1 = $this->createMock(TransportInterface::class);
60-
$t1->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
60+
$t1->expects($this->once())->method('send')->willThrowException(new TransportException());
6161
$t2 = $this->createMock(TransportInterface::class);
62-
$t2->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
62+
$t2->expects($this->once())->method('send')->willThrowException(new TransportException());
6363
$t = new FailoverTransport([$t1, $t2]);
6464
$this->expectException(TransportException::class);
6565
$this->expectExceptionMessage('All transports failed.');
@@ -70,7 +70,7 @@ public function testSendAllDead()
7070
public function testSendOneDead()
7171
{
7272
$t1 = $this->createMock(TransportInterface::class);
73-
$t1->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
73+
$t1->expects($this->once())->method('send')->willThrowException(new TransportException());
7474
$t2 = $this->createMock(TransportInterface::class);
7575
$t2->expects($this->exactly(3))->method('send');
7676
$t = new FailoverTransport([$t1, $t2]);

Tests/Transport/RoundRobinTransportTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ public function testSendAlternate()
5757
public function testSendAllDead()
5858
{
5959
$t1 = $this->createMock(TransportInterface::class);
60-
$t1->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
60+
$t1->expects($this->once())->method('send')->willThrowException(new TransportException());
6161
$t2 = $this->createMock(TransportInterface::class);
62-
$t2->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
62+
$t2->expects($this->once())->method('send')->willThrowException(new TransportException());
6363
$t = new RoundRobinTransport([$t1, $t2]);
6464
$p = new \ReflectionProperty($t, 'cursor');
6565
$p->setValue($t, 0);
@@ -80,7 +80,7 @@ public function testSendAllDead()
8080
public function testSendOneDead()
8181
{
8282
$t1 = $this->createMock(TransportInterface::class);
83-
$t1->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
83+
$t1->expects($this->once())->method('send')->willThrowException(new TransportException());
8484
$t2 = $this->createMock(TransportInterface::class);
8585
$t2->expects($this->exactly(3))->method('send');
8686
$t = new RoundRobinTransport([$t1, $t2]);
@@ -99,7 +99,7 @@ public function testSendOneDeadAndRecoveryNotWithinRetryPeriod()
9999
$t1 = $this->createMock(TransportInterface::class);
100100
$t1->expects($this->exactly(4))->method('send');
101101
$t2 = $this->createMock(TransportInterface::class);
102-
$t2->expects($this->once())->method('send')->will($this->throwException(new TransportException()));
102+
$t2->expects($this->once())->method('send')->willThrowException(new TransportException());
103103
$t = new RoundRobinTransport([$t1, $t2], 60);
104104
$p = new \ReflectionProperty($t, 'cursor');
105105
$p->setValue($t, 0);
@@ -148,13 +148,13 @@ public function testFailureDebugInformation()
148148
$t1 = $this->createMock(TransportInterface::class);
149149
$e1 = new TransportException();
150150
$e1->appendDebug('Debug message 1');
151-
$t1->expects($this->once())->method('send')->will($this->throwException($e1));
151+
$t1->expects($this->once())->method('send')->willThrowException($e1);
152152
$t1->expects($this->once())->method('__toString')->willReturn('t1');
153153

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

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

0 commit comments

Comments
 (0)