|
13 | 13 |
|
14 | 14 | use PHPUnit\Framework\TestCase; |
15 | 15 | use Symfony\Bridge\PhpUnit\ClockMock; |
16 | | -use Symfony\Component\Cache\Adapter\FilesystemTagAwareAdapter; |
17 | | -use Symfony\Component\Cache\Traits\FilesystemTrait; |
18 | | -use Symfony\Component\Filesystem\Filesystem; |
| 16 | +use Symfony\Component\Cache\Adapter\ArrayAdapter; |
| 17 | +use Symfony\Component\Cache\Adapter\TagAwareAdapter; |
| 18 | +use Symfony\Component\Cache\Adapter\TagAwareAdapterInterface; |
19 | 19 | use Symfony\Component\HttpClient\CachingHttpClient; |
20 | 20 | use Symfony\Component\HttpClient\MockHttpClient; |
21 | 21 | use Symfony\Component\HttpClient\Response\AsyncResponse; |
|
28 | 28 | */ |
29 | 29 | class CachingHttpClientTest extends TestCase |
30 | 30 | { |
31 | | - private FilesystemTagAwareAdapter $cacheAdapter; |
| 31 | + private TagAwareAdapterInterface $cacheAdapter; |
32 | 32 |
|
33 | 33 | protected function setUp(): void |
34 | 34 | { |
35 | 35 | parent::setUp(); |
36 | 36 |
|
37 | | - $this->cacheAdapter = new FilesystemTagAwareAdapter('', 0, __DIR__.\DIRECTORY_SEPARATOR.'caching-http-client'); |
| 37 | + $this->cacheAdapter = new TagAwareAdapter(new ArrayAdapter()); |
38 | 38 |
|
39 | 39 | if (class_exists(ClockMock::class)) { |
40 | | - ClockMock::register(FilesystemTrait::class); |
| 40 | + ClockMock::register(TagAwareAdapter::class); |
41 | 41 | } |
42 | 42 | } |
43 | 43 |
|
44 | | - protected function tearDown(): void |
45 | | - { |
46 | | - (new Filesystem())->remove(__DIR__.\DIRECTORY_SEPARATOR.'caching-http-client'); |
47 | | - } |
48 | | - |
49 | 44 | public function testBypassCacheWhenBodyPresent() |
50 | 45 | { |
51 | 46 | // If a request has a non-empty body, caching should be bypassed. |
|
0 commit comments