createMock(User::class); $user->expects($this->once())->method('getIdentifier')->willReturn('userId'); $class = $this->createMock(core_kernel_classes_Class::class); $class->expects($this->once())->method('getUri')->willReturn('classUri'); $factory = new GetAllChildrenCacheKeyFactory(); $key = $factory->create($class, $user); $this->assertEquals('SRS:userId:classUri', $key); } }