New test for the stomp extension

v1.1
Pierrick Charron 2010-01-18 03:25:16 +00:00
parent 3b149a22b1
commit e2a724ed9b
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
--TEST--
Test stomp::readFrame() - custom frame class
--SKIPIF--
<?php
if (!extension_loaded("stomp")) print "skip";
if (!stomp_connect()) print "skip";
?>
--FILE--
<?php
class customFrame extends stompFrame
{
public function __construct($cmd, $headers, $body)
{
parent::__construct($cmd, $headers, $body);
}
}
$s = new Stomp();
$s->send('/queue/test-09', 'A test Message');
$s->subscribe('/queue/test-09');
$frame = $s->readFrame('customFrame');
var_dump(get_class($frame), $frame->body);
?>
--EXPECT--
string(11) "customFrame"
string(14) "A test Message"