Server IP : 66.29.132.122 / Your IP : 18.119.213.216 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/tests/alt-php82-phpiredis_1.0.1-1.el8/ |
Upload File : |
--TEST-- [READER] Set custom error handler --SKIPIF-- <?php require_once 'testsuite_skipif.inc'; --FILE-- <?php $expectedErrorText = 'ERR after handler'; function error_handler($err) { return $err." after handler"; } $reader = phpiredis_reader_create(); phpiredis_reader_feed($reader, "-ERR\r\n"); $reply = phpiredis_reader_get_reply($reader); if ($reply !== 'ERR') { echo "Reply '$reply' != 'ERR' on line ".__LINE__." \n"; } phpiredis_reader_set_error_handler($reader, 'error_handler'); phpiredis_reader_feed($reader, "-ERR\r\n"); $reply = phpiredis_reader_get_reply($reader); if ($reply != $expectedErrorText) { echo "Reply '$reply' != '$expectedErrorText' on line ".__LINE__." \n"; } $failResult = @phpiredis_reader_set_error_handler($reader, 'fake_error_handler'); if ($failResult !== FALSE) { echo "Did not get FALSE when creating a fake_error_handler \n"; } phpiredis_reader_feed($reader, "-ERR\r\n"); $reply = phpiredis_reader_get_reply($reader); if ($reply != $expectedErrorText) { echo "Reply '$reply' is not equal to '$expectedErrorText' on line ".__LINE__." \n"; } $result = phpiredis_reader_set_error_handler($reader, NULL); if ($result !== TRUE) { echo "Result '$result' is not true when setting NULL error handler'"; } phpiredis_reader_feed($reader, "-ERR\r\n"); $reply = phpiredis_reader_get_reply($reader); if ($reply !== 'ERR') { echo "Reply '$reply' is not equal to 'ERR' on line ".__LINE__." \n"; } --EXPECT--