Create helper to mock iterators

Created on 20 April 2025, 3 months ago

Problem/Motivation

Steps to reproduce

I was unit testing some code which did a foreach ($entity->get('foo') as $item) and found a nice way to mock a field item list, asked in Slack how to contribute it back and cmlara said "We really do need more 'pre-made helpers' in core. All too often I hit a "why isn't there a pre-built mock for this?" situation." so here we are.

Proposed resolution

Add a helper.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

phpunit

Created by

πŸ‡¨πŸ‡¦Canada Charlie ChX Negyesi 🍁Canada

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024