--- ../test/DnsCacheTrainer.php	2026-07-26 01:38:35.279736543 +0300
+++ ../test/DnsCacheTrainer.php	2026-07-26 01:42:40.037369980 +0300
@@ -4,23 +4,14 @@
 
 use Amp\Cache\Cache;
 use Amp\Dns\DnsRecord;
-use PHPUnit\Framework\TestCase;
 
 final class DnsCacheTrainer
 {
-    private Cache $mock;
-
     private array $operations = [];
 
-    public function __construct(TestCase $testCase)
-    {
-        /** @noinspection PhpFieldAssignmentTypeMismatchInspection */
-        $this->mock = $testCase->getMockBuilder(Cache::class)
-            ->disableOriginalConstructor()
-            ->disableOriginalClone()
-            ->disableArgumentCloning()
-            ->disallowMockingUnknownTypes()
-            ->getMock();
+    public function __construct(
+        private readonly Cache $mock,
+    ) {
     }
 
     public function givenResponse(DnsRecord ...$records): void
@@ -28,7 +19,13 @@
         $this->mock->method('get')->willReturnCallback(function ($key) use ($records) {
             $this->operations[] = ['get', $key];
 
-            return \array_map(fn ($record) => [$record->getValue(), $record->getType()], $records);
+            return \array_map(
+                    static fn (DnsRecord $record): array => [
+                        $record->getValue(),
+                        $record->getType(),
+                    ],
+                    $records,
+            );
         });
     }
 
