php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70543 Test sapi/cli/tests/016.phpt fails when readline is dynamic extension
Submitted: 2015-09-21 09:58 UTC Modified: 2018-03-09 13:44 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: rainer dot jung at kippdata dot de Assigned:
Status: Open Package: Testing related
PHP Version: 7.0.0RC3 OS: Any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-09-21 09:58 UTC] rainer dot jung at kippdata dot de
Description:
------------
Test sapi/cli/tests/016.phpt fails when either readline is build as a dynamically loadable extension. One reason is that the test expects in the output the string "Interactive shell", but due to the following code

#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
                        printf("Interactive shell\n\n");
#else
                        printf("Interactive mode enabled\n\n");
#endif


in sapi/cli/php_cli.c the test actually prints "Interactive mode enabled".

There are output deltas, mostly due to the fact, that the test expects more output from running the snippets.

Example expected for snippet1:

--------------
Snippet no. 1:
--------------
Interactive shell

php > echo 'Hello world';
Hello world
php > exit

Actually for snippet 1:

--------------
Snippet no. 1:
--------------
Interactive mode enabled

echo 'Hello world';
exit

Either we disable the test when the readline extension is dynamically loaded, or the output which we test against must be modified. Unfortuanetyl as the test currently is designed, in the dynamic extension case the remaining output doesn't provide much test coverage.

The problem happens for the latest 5.4-5.6 releases and for 7RC3.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-21 12:58 UTC] rainer dot jung at kippdata dot de
There is exactly one other test that also suffers from interactive mode problems with dynamically loaded readline: sapi/cli/tests/bug64529.phpt.

In that test the problem with the interactive heading is fixed using the expactation pattern "Interactive %s", but the rest of the test output still does not match the expectation.

Expected:

...
Interactive %s

%Secho 'hello world';
%Shello world


Actual:

...
Interactive mode enabled

echo 'hello world';
echo 'hello world';

It seems no other tests use the interactive mode, only these two.
 [2018-03-09 13:44 UTC] cmb@php.net
-Package: CGI/CLI related +Package: Testing related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu May 23 21:01:26 2019 UTC