示例#1
0
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->stomp = ClientProvider::getClient();
     $this->stomp->setSync(false);
     $this->simpleStomp = new SimpleStomp($this->stomp);
 }
示例#2
0
 public function testCommitTransaction()
 {
     $this->assertTrue($this->Stomp->connect());
     $this->Stomp->setSync(true);
     $this->assertTrue($this->simpleStomp->begin('my-id'));
     $this->assertTrue($this->Stomp->send('/queue/test', 'test 1', ['transaction' => 'my-id']));
     $this->assertTrue($this->simpleStomp->commit('my-id'));
     $this->assertTrue($this->simpleStomp->subscribe('/queue/test', 'mysubid'));
     $frame = $this->Stomp->readFrame();
     $this->assertEquals('test 1', $frame->body, 'test 1 not received!');
     $this->simpleStomp->ack($frame);
 }