php-vcr icon indicating copy to clipboard operation
php-vcr copied to clipboard

BUGFIX: ErrorException in VCR/Storage/Yaml.php:61

Open bomas13 opened this issue 5 years ago • 1 comments

Context

if the fixture is recently created and it has no content, the parser returns null to $recording. And array-like access to null via $recording[0] will raise an exception. With this little check this behavior is fixed and also all tests will work properly.

What has been done

  • added a check if $response is null

How to test

  • write a simple vcr test and try to record a whole new fixture

Todo

  • merge into php-vcr/php-vcr:master and tag a new version

Notes

  • thanks to @morozov who fixed the streamfilter bug
  • thanks to @danielbecker who helped debugging this issue
  • see https://github.com/php-vcr/php-vcr/issues/289

bomas13 avatar Jan 31 '20 08:01 bomas13

Since commit 42ec927 already has a separate PR (https://github.com/php-vcr/php-vcr/pull/293) which pre-dates this one, maybe it would be better to treat these two issues separately?

bwood avatar Apr 27 '20 23:04 bwood