Skip to content

run Zend_Session, Zend_OpenId and Zend_Soap tests in CI - #249

Open
falkenhawk wants to merge 1 commit into
masterfrom
ci-run-buffered-test-suites
Open

falkenhawk wants to merge 1 commit into
masterfrom
ci-run-buffered-test-suites

Conversation

@falkenhawk

Copy link
Copy Markdown
Member

CI never ran the tests of Zend_Session, Zend_OpenId and Zend_Soap.
tests/AllTests.php keeps them in a separate suite, suiteBuffered(), because they used to need that no output is sent before them.
Only php tests/AllTests.php runs that suite. phpunit, as used in CI, runs AllTests::suite() only.
In addition, CI did not install the soap extension.

So problems in these components went unnoticed, see the fixes below and the PRs this one depends on.

1) Running the suites

phpunit.xml.dist gets a second testsuite with the files of suiteBuffered(), run before the regular suite, like php tests/AllTests.php does.
The tests that need no prior output run in separate processes, so they pass with phpunit too.
CI installs the soap extension.

2) Zend_Soap

  • Zend_Soap_Server::addFunction() read the SOAP_FUNCTIONS_ALL constant on every call, which php 8.4 deprecated. It now compares with the value of the constant, 999.
  • two test functions trigger E_USER_ERROR, which php 8.4 deprecated. A @ hides only that deprecation: error handlers are still called, so Zend_Soap_Server still turns the error into a SOAP fault, which is what the test checks.

Other forks:

  • zf1-future uses @SOAP_FUNCTIONS_ALL (Shardj/zf1-future#519), which still reads the constant and will break once php 9 removes it
  • zfbase/zf1-future adds a public constant Zend_Soap_Server::FUNCTIONS_ALL for the value, and uses the same @trigger_error() in the tests
  • diablomedia/zf1-soap#294 dropped support for "all functions"

3) Zend_Session in unit test mode

In unit test mode Zend_Session::start() skips session_start(), so $_SESSION was never defined.
php < 8.1 warns when a key of an undefined $_SESSION is unset, so the Zend_OpenId provider tests failed on php 7.1 - 8.0.
start() now defines $_SESSION in unit test mode, as session_start() would. Nothing changes outside of unit test mode.

Merge order

CI of this PR stays red until these are merged:

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