File: amqpexchange_publish_with_properties_ignore_num_header.phpt

package info (click to toggle)
php-amqp 1.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,024 kB
  • ctags: 578
  • sloc: ansic: 4,223; xml: 784; php: 445; pascal: 42; makefile: 1
file content (30 lines) | stat: -rw-r--r-- 841 bytes parent folder | download | duplicates (4)
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
--TEST--
AMQPExchange publish with properties - ignore numeric keys in headers
--SKIPIF--
<?php if (!extension_loaded("amqp")) print "skip"; ?>
--FILE--
<?php
$cnn = new AMQPConnection();
$cnn->connect();

$ch = new AMQPChannel($cnn);

$ex = new AMQPExchange($ch);
$ex->setName("exchange-" . microtime(true));
$ex->setType(AMQP_EX_TYPE_FANOUT);
$ex->declareExchange();


echo $ex->publish('message', 'routing.key', AMQP_NOPARAM, array('headers' => 'ignored')) ? 'true' : 'false', PHP_EOL;
echo $ex->publish('message', 'routing.key', AMQP_NOPARAM, array('headers' => array(2 => 'ignore_me'))) ? 'true' : 'false', PHP_EOL;

$ex->delete();


?>
--EXPECTF--
Warning: AMQPExchange::publish(): Ignoring non-string header field '0' in %s on line %d
true

Warning: AMQPExchange::publish(): Ignoring non-string header field '2' in %s on line %d
true