8000 Expect deprecation in tests · symfony/symfony@2c6f070 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c6f070

Browse files
committed
Expect deprecation in tests
1 parent 7ce5987 commit 2c6f070

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Symfony/Component/HttpClient/Tests/HttplugClientTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Http\Promise\Promise;
1919
use PHPUnit\Framework\TestCase;
2020
use Psr\Http\Message\ResponseInterface;
21+
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
2122
use Symfony\Component\HttpClient\Exception\TransportException;
2223
use Symfony\Component\HttpClient\HttplugClient;
2324
use Symfony\Component\HttpClient\MockHttpClient;
@@ -27,13 +28,20 @@
2728

2829
class HttplugClientTest extends TestCase
2930
{
31+
use ExpectDeprecationTrait;
32+
3033
public static function setUpBeforeClass(): void
3134
{
3235
TestHttpServer::start();
3336
}
3437

38+
/**
39+
* @group legacy
40+
*/
3541
public function testSendRequest()
3642
{
43+
$this->expectDeprecation('Since symfony/http-client 6.3: The "Symfony\Component\HttpClient\HttplugClient::sendRequest()" method is deprecated, use "Psr\Http\Client\ClientInterface::sendRequest()" instead.');
44+
3745
$client = new HttplugClient(new NativeHttpClient());
3846

3947
$response = $client->sendRequest($client->createRequest('GET', 'http://localhost:8057'));
@@ -103,8 +111,13 @@ public function testWait()
103111
$this->assertFalse($failureCallableCalled, 'Failure callable should not be called when request is successful.');
104112
}
105113

114+
/**
115+
* @group legacy
116+
*/
106117
public function testPostRequest()
107118
{
119+
$this->expectDeprecation('Since symfony/http-client 6.3: The "Symfony\Component\HttpClient\HttplugClient::sendRequest()" method is deprecated, use "Psr\Http\Client\ClientInterface::sendRequest()" instead.');
120+
108121
$client = new HttplugClient(new NativeHttpClient());
109122

110123
$request = $client->createRequest('POST', 'http://localhost:8057/post')

0 commit comments

Comments
 (0)
0