Server IP : 66.29.132.122 / Your IP : 13.59.106.251 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 status handler --SKIPIF-- <?php require_once 'testsuite_skipif.inc'; --FILE-- <?php function status_handler($payload) { return "CUSTOM $payload"; } $reader = phpiredis_reader_create(); phpiredis_reader_feed($reader, "+OK\r\n"); var_dump(phpiredis_reader_get_reply($reader) === 'OK'); phpiredis_reader_set_status_handler($reader, 'status_handler'); phpiredis_reader_feed($reader, "+OK\r\n"); var_dump(phpiredis_reader_get_reply($reader) === 'CUSTOM OK'); var_dump(FALSE === @phpiredis_reader_set_status_handler($reader, 'fake_status_handler')); phpiredis_reader_feed($reader, "+PONG\r\n"); var_dump(phpiredis_reader_get_reply($reader) === 'CUSTOM PONG'); var_dump(TRUE === phpiredis_reader_set_status_handler($reader, NULL)); phpiredis_reader_feed($reader, "+QUEUED\r\n"); var_dump(phpiredis_reader_get_reply($reader) === 'QUEUED'); --EXPECT-- bool(true) bool(true) bool(true) bool(true) bool(true) bool(true)