Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix: Notice Trying to access array offset on value of type null when …#301

Closed
bwood wants to merge 1 commit intophp-vcr:masterfrom
bwood:array-offset-value-type-null
Closed

Fix: Notice Trying to access array offset on value of type null when …#301
bwood wants to merge 1 commit intophp-vcr:masterfrom
bwood:array-offset-value-type-null

Conversation

@bwood
Copy link
Contributor

@bwood bwood commented Apr 28, 2020

…using PHP 7.4.

Context

Ensure that variable is an array. PHP 7.4 is less forgiving about this than earlier versions of PHP. New fixtures can result in a $recording value of NULL. When this happens PHP 7.4 emits a notice. The notice appears in the output of functions under test by Behat and cause failures.

What has been done

Add a conditional testing that $recording is an array with at least one element.

How to test

Without this modification, create a new recording file (aka fixture) and attempt to play it back. Use PHP 7.4.

@bwood
Copy link
Contributor Author

bwood commented Apr 28, 2020

I appreciate @bomas13's work in #295.

I created this PR because I've already applied #293 as a patch, and I need another patch covering just this issue.

As mentioned in #295, I think the tests I use here might be a bit more exact, but feel free to correct me if I'm wrong about that! :-)

@bwood
Copy link
Contributor Author

bwood commented Jun 3, 2020

This has been resolved @JeroenVanOort's commit: 198dfb2

@bwood bwood closed this Jun 3, 2020
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.

1 participant