Skip to content

Commit 47d7343

Browse files
author
Marcus Stöhr
authored
docs: Add missing use-statement for trait
1 parent cddeec6 commit 47d7343

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.http-client-trait.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,22 @@ In your test, you can provide mock responses, which will be matched by the given
3131
```php
3232
// MyTest.php
3333

34-
public function testRequest(): void
34+
use Brainbits\FunctionalTestHelpers\HttpClientMock\HttpClientMockTrait;
35+
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
36+
37+
final class MyTest extends WebTestCase
3538
{
36-
$this->mockRequest('GET', 'http://127.0.0.1/my/endpoint')
37-
->willRespond($this->mockResponse()->json([]));
39+
use HttpClientMockTrait;
40+
41+
public function testRequest(): void
42+
{
43+
$this->mockRequest('GET', 'http://127.0.0.1/my/endpoint')
44+
->willRespond($this->mockResponse()->json([]));
3845

39-
// ...
46+
// ...
4047

41-
Assert::assertNotEmpty($this->callStack()->first);
48+
Assert::assertNotEmpty($this->callStack()->first);
49+
}
4250
}
4351

4452
```

0 commit comments

Comments
 (0)