summaryrefslogtreecommitdiff
path: root/ext/sysvmsg/tests/001.phpt
blob: bc1691316b9757bafc01c232b8084d85be9c0e3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
send/receive serialized message.
--SKIPIF--
<?php // vim600:syn=php
if (!extension_loaded("sysvmsg")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php 
$key = ftok("./ext/sysvmsg/tests/001.phpt", "p");
$q = msg_get_queue($key);
msg_send($q, 1, "hello") or print "FAIL\n";
$type = null;
if (msg_receive($q, 0, $type, 1024, $message)) {
	echo "TYPE: $type\n";
	echo "DATA: $message\n";
}
if (!msg_remove_queue($q)) {
	echo "BAD: queue removal failed\n";
}
?>
--EXPECT--
TYPE: 1
DATA: hello