forked from php-amqp/php-amqp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bug_gh53-2.phpt
36 lines (29 loc) · 846 Bytes
/
bug_gh53-2.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--TEST--
Upgrade to RabbitMQ 3.1.0-1: AMQPConnectionException: connection closed unexpectedly (2)
--SKIPIF--
<?php if (!extension_loaded("amqp")) print "skip"; ?>
--FILE--
<?php
$connection = new AMQPConnection();
$connection->connect();
$channel = new AMQPChannel($connection);
$exchange = new AMQPExchange($channel);
$exchange->setName('exchange' . time());
$exchange->setType(AMQP_EX_TYPE_TOPIC);
$exchange->declareExchange();
$queue = new AMQPQueue($channel);
$queue->setName('queue1' . time());
$queue->declareQueue();
$queue->bind($exchange->getName(), '#');
$exchange->publish('body1', 'routing.1');
$exchange->publish('body2', 'routing.1');
$msg = $queue->get(AMQP_AUTOACK);
var_dump($msg->getBody());
$msg = $queue->get(AMQP_AUTOACK);
var_dump($msg->getBody());
?>
==DONE==
--EXPECT--
string(5) "body1"
string(5) "body2"
==DONE==