Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F630694
amqpexchange_attributes.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
amqpexchange_attributes.phpt
View Options
--TEST--
AMQPExchange attributes
--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->setArguments($arr = array('existent' => 'value', 'false' => false, 'null' => null));
echo 'Initial args: ', count($arr), ', exchange args: ', count($ex->getArguments()), PHP_EOL;
$ex->setArgument('foo', 'bar');
echo 'Initial args: ', count($arr), ', exchange args: ', count($ex->getArguments()), PHP_EOL;
foreach (array('existent', 'false', 'null', 'nonexistent') as $key) {
echo "$key: ";
var_export($ex->hasArgument($key));
echo ', ';
try {
var_export($ex->getArgument($key));
} catch (AMQPExchangeException $e) {
echo "Ex: " . $e->getMessage();
}
echo PHP_EOL;
}
?>
--EXPECT--
Initial args: 3, exchange args: 3
Initial args: 3, exchange args: 4
existent: true, 'value'
false: true, false
null: true, NULL
nonexistent: false, Ex: The argument "nonexistent" does not exist
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 10:08 AM (11 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
141406
Default Alt Text
amqpexchange_attributes.phpt (1 KB)
Attached To
Mode
R113 php-ampqp
Attached
Detach File
Event Timeline