Page MenuHomePhabricator (Chris)

amqpchannel_confirmSelect.phpt
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

amqpchannel_confirmSelect.phpt

--TEST--
AMQPChannel::confirmSelect()
--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);
$ch->confirmSelect();
echo 'confirm.select: OK', PHP_EOL;
try {
$ch->startTransaction();
} catch (Exception $e) {
echo get_class($e), "({$e->getCode()}): " . $e->getMessage(), PHP_EOL;
}
$ch = new AMQPChannel($cnn);
$ch->startTransaction();
echo 'transaction.start: OK', PHP_EOL;
try {
$ch->confirmSelect();
} catch (Exception $e) {
echo get_class($e), "({$e->getCode()}): " . $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
confirm.select: OK
AMQPChannelException(406): Server channel error: 406, message: PRECONDITION_FAILED - cannot switch from confirm to tx mode
transaction.start: OK
AMQPChannelException(406): Server channel error: 406, message: PRECONDITION_FAILED - cannot switch from tx to confirm mode

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 15, 2:53 PM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
145597
Default Alt Text
amqpchannel_confirmSelect.phpt (1 KB)

Event Timeline