Page MenuHomePhabricator (Chris)

amqpexchange_declare_with_stalled_reference.phpt
No OneTemporary

Authored By
Unknown
Size
827 B
Referenced Files
None
Subscribers
None

amqpexchange_declare_with_stalled_reference.phpt

--TEST--
AMQPExchange - declare with stalled reference
--SKIPIF--
<?php if (!extension_loaded("amqp")) print "skip"; ?>
--FILE--
<?php
class ConnectionMock extends AMQPConnection {
public function __construct(array $credentials = array())
{
}
}
class ChannelMock extends AMQPChannel {
public function __construct(AMQPConnection $amqp_connection)
{
}
}
class ExchangeMock extends \AMQPExchange
{
public function __construct(AMQPChannel $amqp_channel)
{
}
}
$cnn = new ConnectionMock();
$ch = new ChannelMock($cnn);
$e = new ExchangeMock($ch);
try {
$e->declareExchange();
} catch (\Exception $e) {
echo get_class($e), "({$e->getCode()}): ", $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
AMQPChannelException(0): Could not declare exchange. Stale reference to the channel object.

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 14, 10:06 PM (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
145432
Default Alt Text
amqpexchange_declare_with_stalled_reference.phpt (827 B)

Event Timeline