Skip to content

Conversation

@jderusse
Copy link
Member

@jderusse jderusse commented Nov 7, 2025

Fix failling test when the DataProviders returns an empty list.

https://github.com/async-aws/aws/actions/runs/19167154579/job/54790443661#step:8:52

@jderusse jderusse merged commit cf69e80 into async-aws:master Nov 7, 2025
12 checks passed
@jderusse jderusse deleted the fix branch November 7, 2025 14:23

if (0 === \count($branches)) {
self::markTestSkipped('Cannot find the master branch');
yield [null, null, null];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why yielding null which will trigger a type error ?

Also, markTestSkipped was throwing, which was stopping the data provider.
Now, such case would trigger a notice when accessing $branches[0]

Copy link
Member Author

@jderusse jderusse Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yielding null is a mistake and should be fixed by #1985

Throwing an exception in the dataprovider breaks the test suite => https://github.com/async-aws/aws/actions/runs/19174431727/job/54815354423#step:8:11

yielding a dummy value is the single way I found to prevent PhpUnit from throwing an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants