repository = new CacheClassDefinitionRepository( new FakeClassDefinitionRepository(), new FakeCache() ); } public function test_class_is_saved_in_cache(): void { $signatureA = new ClassSignature(stdClass::class); $signatureB = new ClassSignature(DateTime::class); $classA = $this->repository->for($signatureA); $classB = $this->repository->for($signatureA); $classC = $this->repository->for($signatureB); self::assertSame($classA, $classB); self::assertNotSame($classA, $classC); } }