From cc626d9cd9ea2768d0092265066014c7ebf6cc59 Mon Sep 17 00:00:00 2001 From: pinepain Date: Tue, 8 Jan 2013 03:44:45 +0200 Subject: [PATCH] remove shutup operator, ANSI C comments, iniArr renamed to ini_arr --- .travis.yml | 6 ++-- amqp_connection.c | 31 ++++++++---------- amqp_exchange.c | 32 +++++++++---------- amqp_queue.c | 2 +- php_amqp.h | 1 - tests/amqpchannel_var_dump.phpt | 1 + ...onnection_setReadTimeout_out_of_range.phpt | 3 +- .../amqpconnection_setReadTimeout_string.phpt | 2 +- tests/amqpconnection_setTimeout_float.phpt | 17 +++++++--- tests/amqpconnection_setTimeout_int.phpt | 9 ++++-- ...mqpconnection_setTimeout_out_of_range.phpt | 7 ++-- tests/amqpconnection_setTimeout_string.phpt | 19 +++++++---- .../amqpconnection_setWriteTimeout_float.phpt | 2 +- ...nnection_setWriteTimeout_out_of_range.phpt | 3 +- ...amqpconnection_setWriteTimeout_string.phpt | 5 +-- tests/amqpconnection_var_dump.phpt | 1 + tests/amqpexchange_publish_timeout.phpt | 14 ++------ 17 files changed, 82 insertions(+), 73 deletions(-) diff --git a/.travis.yml b/.travis.yml index 266d3841..147ac5cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,6 @@ before_script: - sh -c "cd rabbitmq-c && git submodule init && git submodule update" - sh -c "cd rabbitmq-c && autoreconf -i && ./configure && make && sudo make install" - sh -c "phpize && ./configure && make" -# - sudo rabbitmqctl set_vm_memory_high_watermark 0.01 script: - sh -c "make test | tee result.txt" @@ -26,6 +25,5 @@ script: notifications: email: - - pinepain@gmail.com -# - lstrojny@php.net -# - bkw@codingforce.com + - lstrojny@php.net + - bkw@codingforce.com diff --git a/amqp_connection.c b/amqp_connection.c index d15d828e..8d71fcbc 100644 --- a/amqp_connection.c +++ b/amqp_connection.c @@ -471,14 +471,11 @@ PHP_METHOD(amqp_connection_class, __construct) zval *id; amqp_connection_object *connection; - zval* iniArr = NULL; + zval* ini_arr = NULL; zval** zdata; -// double ini_amqp_timeout; -// double ini_amqp_read_timeout; - /* Parse out the method parameters */ - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|a", &id, amqp_connection_class_entry, &iniArr) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|a", &id, amqp_connection_class_entry, &ini_arr) == FAILURE) { return; } @@ -487,7 +484,7 @@ PHP_METHOD(amqp_connection_class, __construct) /* Pull the login out of the $params array */ zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "login", sizeof("login"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "login", sizeof("login"), (void*)&zdata)) { convert_to_string(*zdata); } /* Validate the given login */ @@ -505,7 +502,7 @@ PHP_METHOD(amqp_connection_class, __construct) /* Pull the password out of the $params array */ zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF(iniArr), "password", sizeof("password"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF(ini_arr), "password", sizeof("password"), (void*)&zdata)) { convert_to_string(*zdata); } /* Validate the given password */ @@ -522,7 +519,7 @@ PHP_METHOD(amqp_connection_class, __construct) /* Pull the host out of the $params array */ zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF(iniArr), "host", sizeof("host"), (void *)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF(ini_arr), "host", sizeof("host"), (void *)&zdata)) { convert_to_string(*zdata); } /* Validate the given host */ @@ -539,7 +536,7 @@ PHP_METHOD(amqp_connection_class, __construct) /* Pull the vhost out of the $params array */ zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "vhost", sizeof("vhost"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "vhost", sizeof("vhost"), (void*)&zdata)) { convert_to_string(*zdata); } /* Validate the given vhost */ @@ -556,14 +553,14 @@ PHP_METHOD(amqp_connection_class, __construct) connection->port = INI_INT("amqp.port"); - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "port", sizeof("port"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "port", sizeof("port"), (void*)&zdata)) { convert_to_long(*zdata); connection->port = (size_t)Z_LVAL_PP(zdata); } connection->read_timeout = INI_FLT("amqp.read_timeout"); - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "read_timeout", sizeof("read_timeout"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "read_timeout", sizeof("read_timeout"), (void*)&zdata)) { convert_to_double(*zdata); if (Z_DVAL_PP(zdata) < 0) { zend_throw_exception(amqp_connection_exception_class_entry, "Parameter 'read_timeout' must be greater than or equal to zero.", 0 TSRMLS_CC); @@ -571,12 +568,12 @@ PHP_METHOD(amqp_connection_class, __construct) connection->read_timeout = Z_DVAL_PP(zdata); } - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "timeout", sizeof("timeout"), (void*)&zdata)) { - // 'read_timeout' takes preccedande on 'timeout' but users have to know this + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "timeout", sizeof("timeout"), (void*)&zdata)) { + /* 'read_timeout' takes precedence on 'timeout' but users have to know this */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Parameter 'timeout' is deprecated, 'read_timeout' used instead"); } - } else if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "timeout", sizeof("timeout"), (void*)&zdata)) { + } else if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "timeout", sizeof("timeout"), (void*)&zdata)) { php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "Parameter 'timeout' is deprecated; use 'read_timeout' instead"); @@ -604,7 +601,7 @@ PHP_METHOD(amqp_connection_class, __construct) connection->write_timeout = INI_FLT("amqp.write_timeout"); - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "write_timeout", sizeof("write_timeout"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "write_timeout", sizeof("write_timeout"), (void*)&zdata)) { convert_to_double(*zdata); if (Z_DVAL_PP(zdata) < 0) { zend_throw_exception(amqp_connection_exception_class_entry, "Parameter 'write_timeout' must be greater than or equal to zero.", 0 TSRMLS_CC); @@ -1087,8 +1084,8 @@ PHP_METHOD(amqp_connection_class, setVhost) } /* }}} */ -// @deprecated /* {{{ proto amqp::getTimeout() +@deprecated get the timeout */ PHP_METHOD(amqp_connection_class, getTimeout) { @@ -1110,8 +1107,8 @@ PHP_METHOD(amqp_connection_class, getTimeout) } /* }}} */ -// @deprecated /* {{{ proto amqp::setTimeout(double timeout) +@deprecated set the timeout */ PHP_METHOD(amqp_connection_class, setTimeout) { diff --git a/amqp_exchange.c b/amqp_exchange.c index 1d13a5ab..30c89a97 100644 --- a/amqp_exchange.c +++ b/amqp_exchange.c @@ -116,7 +116,7 @@ zend_object_value amqp_exchange_ctor(zend_class_entry *ce TSRMLS_DC) memset(exchange, 0, sizeof(amqp_exchange_object)); - // Initialize the arguments array: + /* Initialize the arguments array: */ MAKE_STD_ZVAL(exchange->arguments); array_init(exchange->arguments); @@ -585,7 +585,7 @@ publish into Exchange PHP_METHOD(amqp_exchange_class, publish) { zval *id; - zval *iniArr = NULL; + zval *ini_arr = NULL; zval** zdata; amqp_exchange_object *exchange; amqp_channel_object *channel; @@ -610,7 +610,7 @@ PHP_METHOD(amqp_exchange_class, publish) amqp_bytes_t abt0, abt1, abt2; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|sla", &id, amqp_exchange_class_entry, &msg, &msg_len, &key_name, &key_len, &flags, &iniArr) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|sla", &id, amqp_exchange_class_entry, &msg, &msg_len, &key_name, &key_len, &flags, &ini_arr) == FAILURE) { return; } @@ -624,7 +624,7 @@ PHP_METHOD(amqp_exchange_class, publish) props._flags = AMQP_BASIC_CONTENT_TYPE_FLAG; zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "content_type", sizeof("content_type"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "content_type", sizeof("content_type"), (void*)&zdata)) { convert_to_string(*zdata); } if (zdata && strlen(Z_STRVAL_PP(zdata)) > 0) { @@ -634,7 +634,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "content_encoding", sizeof("content_encoding"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "content_encoding", sizeof("content_encoding"), (void*)&zdata)) { convert_to_string(*zdata); } if (zdata && strlen(Z_STRVAL_PP(zdata)) > 0) { @@ -643,7 +643,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "message_id", sizeof("message_id"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "message_id", sizeof("message_id"), (void*)&zdata)) { convert_to_string(*zdata); } if (zdata && strlen(Z_STRVAL_PP(zdata)) > 0) { @@ -652,7 +652,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "user_id", sizeof("user_id"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "user_id", sizeof("user_id"), (void*)&zdata)) { convert_to_string(*zdata); } if (zdata && strlen(Z_STRVAL_PP(zdata)) > 0) { @@ -661,7 +661,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "app_id", sizeof("app_id"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "app_id", sizeof("app_id"), (void*)&zdata)) { convert_to_string(*zdata); } if (zdata && strlen(Z_STRVAL_PP(zdata)) > 0) { @@ -670,7 +670,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "delivery_mode", sizeof("delivery_mode"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "delivery_mode", sizeof("delivery_mode"), (void*)&zdata)) { convert_to_long(*zdata); } if (zdata) { @@ -679,7 +679,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "priority", sizeof("priority"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "priority", sizeof("priority"), (void*)&zdata)) { convert_to_long(*zdata); } if (zdata) { @@ -688,7 +688,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "timestamp", sizeof("timestamp"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "timestamp", sizeof("timestamp"), (void*)&zdata)) { convert_to_long(*zdata); } if (zdata) { @@ -697,7 +697,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "expiration", sizeof("expiration"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "expiration", sizeof("expiration"), (void*)&zdata)) { convert_to_string(*zdata); } if (zdata && strlen(Z_STRVAL_PP(zdata)) > 0) { @@ -706,7 +706,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "type", sizeof("type"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "type", sizeof("type"), (void*)&zdata)) { convert_to_string(*zdata); } if (zdata && strlen(Z_STRVAL_PP(zdata)) > 0) { @@ -715,7 +715,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "reply_to", sizeof("reply_to"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "reply_to", sizeof("reply_to"), (void*)&zdata)) { convert_to_string(*zdata); } if (zdata && strlen(Z_STRVAL_PP(zdata)) > 0) { @@ -724,7 +724,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF (iniArr), "correlation_id", sizeof("correlation_id"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF (ini_arr), "correlation_id", sizeof("correlation_id"), (void*)&zdata)) { convert_to_string(*zdata); } if (zdata && strlen(Z_STRVAL_PP(zdata)) > 0) { @@ -733,7 +733,7 @@ PHP_METHOD(amqp_exchange_class, publish) } zdata = NULL; - if (iniArr && SUCCESS == zend_hash_find(HASH_OF(iniArr), "headers", sizeof("headers"), (void*)&zdata)) { + if (ini_arr && SUCCESS == zend_hash_find(HASH_OF(ini_arr), "headers", sizeof("headers"), (void*)&zdata)) { HashTable *headers; HashPosition pos; diff --git a/amqp_queue.c b/amqp_queue.c index 273e6809..c18148ef 100644 --- a/amqp_queue.c +++ b/amqp_queue.c @@ -130,7 +130,7 @@ zend_object_value amqp_queue_ctor(zend_class_entry *ce TSRMLS_DC) zend_object_std_init(&queue->zo, ce TSRMLS_CC); AMQP_OBJECT_PROPERTIES_INIT(queue->zo, ce); - // Initialize the arguments array: + /* Initialize the arguments array: */ MAKE_STD_ZVAL(queue->arguments); array_init(queue->arguments); diff --git a/php_amqp.h b/php_amqp.h index 071ae265..1bb289a9 100644 --- a/php_amqp.h +++ b/php_amqp.h @@ -291,7 +291,6 @@ extern zend_class_entry *amqp_exception_class_entry, #endif extern int le_amqp_connection_resource; -// ZEND_DECLARE_MODULE_GLOBALS(amqp) typedef struct _amqp_channel_object { zend_object zo; diff --git a/tests/amqpchannel_var_dump.phpt b/tests/amqpchannel_var_dump.phpt index 2e5f8c12..ab33b040 100644 --- a/tests/amqpchannel_var_dump.phpt +++ b/tests/amqpchannel_var_dump.phpt @@ -5,6 +5,7 @@ AMQPChannel var_dump if (!extension_loaded("amqp") || version_compare(PHP_VERSION, '5.3', '<')) { print "skip"; } +?> --FILE-- --FILE-- @@ -12,6 +12,7 @@ try { echo PHP_EOL; echo $e->getMessage(); } +?> --EXPECT-- AMQPConnectionException Parameter 'read_timeout' must be greater than or equal to zero. diff --git a/tests/amqpconnection_setReadTimeout_string.phpt b/tests/amqpconnection_setReadTimeout_string.phpt index fb501344..395b43b6 100644 --- a/tests/amqpconnection_setReadTimeout_string.phpt +++ b/tests/amqpconnection_setReadTimeout_string.phpt @@ -1,5 +1,5 @@ --TEST-- -AMQPConnection setReadTimeout float +AMQPConnection setReadTimeout string --SKIPIF-- --FILE-- diff --git a/tests/amqpconnection_setTimeout_float.phpt b/tests/amqpconnection_setTimeout_float.phpt index 899e9528..119c2bc5 100644 --- a/tests/amqpconnection_setTimeout_float.phpt +++ b/tests/amqpconnection_setTimeout_float.phpt @@ -5,10 +5,17 @@ AMQPConnection setTimeout float --FILE-- setTimeout(.34); -var_dump(@$cnn->getTimeout()); -@$cnn->setTimeout(4.7e-2); -var_dump(@$cnn->getTimeout());?> ---EXPECT-- +$cnn->setTimeout(.34); +var_dump($cnn->getTimeout()); +$cnn->setTimeout(4.7e-2); +var_dump($cnn->getTimeout());?> +--EXPECTF-- +%s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 3 + +%s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 4 float(0.34) + +%s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 5 + +%s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 6 float(0.047) diff --git a/tests/amqpconnection_setTimeout_int.phpt b/tests/amqpconnection_setTimeout_int.phpt index 6adce816..85ecabe6 100644 --- a/tests/amqpconnection_setTimeout_int.phpt +++ b/tests/amqpconnection_setTimeout_int.phpt @@ -5,8 +5,11 @@ AMQPConnection setTimeout int --FILE-- setTimeout(3); -var_dump(@$cnn->getTimeout()); +$cnn->setTimeout(3); +var_dump($cnn->getTimeout()); ?> ---EXPECT-- +--EXPECTF-- +%s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 3 + +%s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 4 float(3) diff --git a/tests/amqpconnection_setTimeout_out_of_range.phpt b/tests/amqpconnection_setTimeout_out_of_range.phpt index cf0ce603..6769f65c 100644 --- a/tests/amqpconnection_setTimeout_out_of_range.phpt +++ b/tests/amqpconnection_setTimeout_out_of_range.phpt @@ -1,18 +1,19 @@ --TEST-- -AMQPConnection setTimeout float +AMQPConnection setTimeout out of range --SKIPIF-- --FILE-- setTimeout(-1); + $cnn->setTimeout(-1); } catch (Exception $e) { echo get_class($e); echo PHP_EOL; echo $e->getMessage(); } ?> ---EXPECT-- +--EXPECTF-- +%s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 4 AMQPConnectionException Parameter 'timeout' must be greater than or equal to zero. diff --git a/tests/amqpconnection_setTimeout_string.phpt b/tests/amqpconnection_setTimeout_string.phpt index b09c6959..c198b4f2 100644 --- a/tests/amqpconnection_setTimeout_string.phpt +++ b/tests/amqpconnection_setTimeout_string.phpt @@ -1,14 +1,21 @@ --TEST-- -AMQPConnection setTimeout float +AMQPConnection setTimeout string --SKIPIF-- --FILE-- setTimeout(".34"); -var_dump(@$cnn->getTimeout()); -@$cnn->setTimeout("4.7e-2"); -var_dump(@$cnn->getTimeout());?> ---EXPECT-- +$cnn->setTimeout(".34"); +var_dump($cnn->getTimeout()); +$cnn->setTimeout("4.7e-2"); +var_dump($cnn->getTimeout());?> +--EXPECTF-- +%s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 3 + +%s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 4 float(0.34) + +%s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 5 + +%s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 6 float(0.047) diff --git a/tests/amqpconnection_setWriteTimeout_float.phpt b/tests/amqpconnection_setWriteTimeout_float.phpt index 5163eec8..8254e29e 100644 --- a/tests/amqpconnection_setWriteTimeout_float.phpt +++ b/tests/amqpconnection_setWriteTimeout_float.phpt @@ -1,5 +1,5 @@ --TEST-- -AMQPConnection setTimeout float +AMQPConnection setWriteTimeout float --SKIPIF-- --FILE-- diff --git a/tests/amqpconnection_setWriteTimeout_out_of_range.phpt b/tests/amqpconnection_setWriteTimeout_out_of_range.phpt index dffa744e..4f6204ac 100644 --- a/tests/amqpconnection_setWriteTimeout_out_of_range.phpt +++ b/tests/amqpconnection_setWriteTimeout_out_of_range.phpt @@ -1,5 +1,5 @@ --TEST-- -AMQPConnection setWriteTimeout float +AMQPConnection setWriteTimeout out of range --SKIPIF-- --FILE-- @@ -12,6 +12,7 @@ try { echo PHP_EOL; echo $e->getMessage(); } +?> --EXPECT-- AMQPConnectionException Parameter 'write_timeout' must be greater than or equal to zero. diff --git a/tests/amqpconnection_setWriteTimeout_string.phpt b/tests/amqpconnection_setWriteTimeout_string.phpt index 95610376..0b9f917f 100644 --- a/tests/amqpconnection_setWriteTimeout_string.phpt +++ b/tests/amqpconnection_setWriteTimeout_string.phpt @@ -1,5 +1,5 @@ --TEST-- -AMQPConnection setWriteTimeout float +AMQPConnection setWriteTimeout string --SKIPIF-- --FILE-- @@ -8,7 +8,8 @@ $cnn = new AMQPConnection(); $cnn->setWriteTimeout(".34"); var_dump($cnn->getWriteTimeout()); $cnn->setWriteTimeout("4.7e-2"); -var_dump($cnn->getWriteTimeout());?> +var_dump($cnn->getWriteTimeout()); +?> --EXPECT-- float(0.34) float(0.047) diff --git a/tests/amqpconnection_var_dump.phpt b/tests/amqpconnection_var_dump.phpt index 6996957c..47e44ab9 100644 --- a/tests/amqpconnection_var_dump.phpt +++ b/tests/amqpconnection_var_dump.phpt @@ -5,6 +5,7 @@ AMQPConnection var_dump if (!extension_loaded("amqp") || version_compare(PHP_VERSION, '5.3', '<')) { print "skip"; } +?> --FILE-- $timeout)); $conn->connect(); @@ -52,14 +49,9 @@ try { echo $e->getMessage(); echo PHP_EOL; } -$delay = abs($end - $start - $timeout); -echo $delay < 0.005 ? 'true' : 'false'; -sleep(60); // at this point messages should already be dead by ttl -$queue->delete(); -$ex->delete(); +//$delay = abs($end - $start - $timeout); +//echo $delay < 0.005 ? 'true' : 'false'; ?> ---EXPECTF-- +--EXPECT-- AMQPExchangeException Socket error: Resource temporarily unavailable -%s -true