xref: /PHP-5.6/ext/sysvmsg/tests/002.phpt (revision f5fb1310)
1--TEST--
2msg_receive() should return false when unserialize() failed
3--SKIPIF--
4<?php if (!extension_loaded("sysvmsg")) die("skip sysvmsg extenions is not available")?>
5--FILE--
6<?php
7
8$queue = msg_get_queue (ftok(__FILE__, 'r'), 0600);
9if (!msg_send ($queue, 1, 'Hi', false /* ! no_ser*/, true/*block*/, $msg_err)) {
10	die("error\n");
11}
12var_dump($res = msg_receive ($queue, 1, $msg_type, 16384, $msg, true, 0, $msg_error));
13
14if (!msg_remove_queue($queue)) {
15	echo "BAD: queue removal failed\n";
16}
17
18echo "Done\n";
19?>
20--EXPECTF--
21Warning: msg_receive(): message corrupted in %s002.php on line %d
22bool(false)
23Done
24