Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F618683
bug_351.phpt
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
bug_351.phpt
View Options
--TEST--
AMQPEnvelope::getBody returns false instead of empty string
--SKIPIF--
<?php
if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded";
elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set";
?>
--FILE--
<?php
$cnn = new AMQPConnection();
$cnn->setHost(getenv('PHP_AMQP_HOST'));
$cnn->connect();
$ch = new AMQPChannel($cnn);
$ex = new AMQPExchange($ch);
$ex->setName('exchange' . bin2hex(random_bytes(32)));
$ex->setType(AMQP_EX_TYPE_FANOUT);
$ex->declareExchange();
$q = new AMQPQueue($ch);
$q->setName('queue1' . bin2hex(random_bytes(32)));
$q->declareQueue();
$q->bind($ex->getName(), '*');
$ex->publish('');
$msg = $q->get(AMQP_AUTOACK);
echo "MSG1\n";
var_dump($msg->getBody(), $msg->getRoutingKey(), $msg->getConsumerTag(), $msg->getDeliveryTag(), $msg->getExchangeName());
$msg2 = new AMQPEnvelope();
echo "MSG2\n";
var_dump($msg2->getBody(), $msg2->getRoutingKey(), $msg2->getConsumerTag(), $msg2->getDeliveryTag(), $msg2->getExchangeName());
?>
==DONE==
--EXPECTF--
MSG1
string(0) ""
string(0) ""
string(0) ""
int(%d)
string(%d) "exchange%s"
MSG2
string(0) ""
string(0) ""
NULL
NULL
NULL
==DONE==
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 14, 3:22 PM (1 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
136767
Default Alt Text
bug_351.phpt (1 KB)
Attached To
Mode
R113 php-ampqp
Attached
Detach File
Event Timeline