zendframework / zend-session

Manage and preserve session data, a logical complement of cookie data, across multiple page requests by the same client.
BSD 3-Clause "New" or "Revised" License
42 stars 64 forks source link

apply php 7.2 to travis #92

Closed samsonasik closed 6 years ago

samsonasik commented 6 years ago

Got following errrors under php 7.2:

There were 6 errors:

1) ZendTest\Session\Config\SessionConfigTest::testSavePathCanBeNonDirectoryWhenSaveHandlerNotFiles

Zend\Session\Exception\InvalidArgumentException: Invalid save handler specified: ini_set(): Cannot set 'user' save handler by ini_set() or session_module_name()

/home/travis/build/zendframework/zend-session/src/Config/SessionConfig.php:148

/home/travis/build/zendframework/zend-session/test/Config/SessionConfigTest.php:68

2) ZendTest\Session\Config\SessionConfigTest::testSaveHandlerIsMutable

ini_set(): Cannot set 'user' save handler by ini_set() or session_module_name()

/home/travis/build/zendframework/zend-session/src/Config/SessionConfig.php:97

/home/travis/build/zendframework/zend-session/src/Config/StandardConfig.php:147

/home/travis/build/zendframework/zend-session/src/Config/StandardConfig.php:912

/home/travis/build/zendframework/zend-session/test/Config/SessionConfigTest.php:105

3) ZendTest\Session\Config\SessionConfigTest::testSaveHandlerAltersIniSetting

ini_set(): Cannot set 'user' save handler by ini_set() or session_module_name()

/home/travis/build/zendframework/zend-session/src/Config/SessionConfig.php:97

/home/travis/build/zendframework/zend-session/src/Config/StandardConfig.php:147

/home/travis/build/zendframework/zend-session/src/Config/StandardConfig.php:912

/home/travis/build/zendframework/zend-session/test/Config/SessionConfigTest.php:111

4) ZendTest\Session\Config\SessionConfigTest::testSetOptionSetsIniSetting with data set #2 ('save_handler', 'getOption', 'user')

ini_set(): Cannot set 'user' save handler by ini_set() or session_module_name()

/home/travis/build/zendframework/zend-session/src/Config/SessionConfig.php:97

/home/travis/build/zendframework/zend-session/test/Config/SessionConfigTest.php:972

5) ZendTest\Session\Config\SessionConfigTest::testSetOptionsTranslatesUnderscoreSeparatedKeys with data set #2 ('save_handler', 'getOption', 'user')

ini_set(): Cannot set 'user' save handler by ini_set() or session_module_name()

/home/travis/build/zendframework/zend-session/src/Config/SessionConfig.php:97

/home/travis/build/zendframework/zend-session/src/Config/StandardConfig.php:147

/home/travis/build/zendframework/zend-session/src/Config/StandardConfig.php:116

/home/travis/build/zendframework/zend-session/test/Config/SessionConfigTest.php:1005

6) ZendTest\Session\SaveHandler\MongoDBTest::testReadDestroysExpiredSession

ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

/home/travis/build/zendframework/zend-session/test/SaveHandler/MongoDBTest.php:97
samsonasik commented 6 years ago

So, any suggestion to get the error gone in php 7.2 ?

michalbundyra commented 6 years ago

@samsonasik I'd suggest to try session_set_save_handler() method, because error message says:

Cannot set 'user' save handler by ini_set() or session_module_name()
michalbundyra commented 6 years ago

@samsonasik Hm... oh, no... sorry. No idea for now. This is not gonna work.

remicollet commented 6 years ago

Same issue from Fedora QA https://apps.fedoraproject.org/koschei/package/php-zendframework-zend-session?collection=f28

weierophinney commented 6 years ago

This is a case where the tests are incorrect; the value "user" was never correct, but previous versions of PHP did not raise an error.

I'll update to provide a mock SessionHandlerInterface implementation.

weierophinney commented 6 years ago

Single test failure is on 5.6-locked, where the MongoDb SaveHandler implementation's garbage collection test reliably fails; passes on all other environments, however, so I'm going to take it as a pass.

weierophinney commented 6 years ago

Thanks, @samsonasik, for getting this started!