Skip to content

[test] fix DbTableTest::testReadWriteTwiceAndExpire on php 8.6 - #246

Open
falkenhawk wants to merge 1 commit into
masterfrom
fix-dbtable-session-test
Open

falkenhawk wants to merge 1 commit into
masterfrom
fix-dbtable-session-test

Conversation

@falkenhawk

Copy link
Copy Markdown
Member

php 8.6 warns when unserialize() gets an empty string (php/php-src#23827). Before, it returned false silently.

DbTableTest::testReadWriteTwiceAndExpire checked an expired session with unserialize($saveHandler->read($id)).
For an expired session read() returns '', so on php 8.6 the test fails with:

unserialize(): Error at offset 0 of 0 bytes

The test now checks that read() returns '', which is what it meant to check.

The unserialize() calls in the library are not affected: they either use @, or only get data that was serialized before, which is never an empty string.

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