public function testAbortTransaction() { $this->assertTrue($this->Stomp->connect()); $this->assertTrue($this->simpleStomp->begin('my-id')); $this->assertTrue($this->Stomp->send('/queue/test', 'test t-id', ['transaction' => 'my-id'])); $this->assertTrue($this->simpleStomp->abort('my-id')); $this->assertTrue($this->simpleStomp->subscribe('/queue/test', 'mysubid')); $this->Stomp->getConnection()->setReadTimeout(0, 500000); $frame = $this->Stomp->readFrame(); $this->assertFalse($frame); }
/** * Tests Stomp->abort() */ public function testAbort() { $this->stomp->getConnection()->setReadTimeout(0, 750000); $this->stomp->connect(); $this->simpleStomp->begin('tx1'); $this->assertTrue($this->stomp->send('/queue/abort', 'testSend', ['transaction' => 'tx1'])); $this->simpleStomp->abort('tx1'); $this->simpleStomp->subscribe('/queue/abort'); $frame = $this->stomp->readFrame(); $this->assertFalse($frame); $this->simpleStomp->unsubscribe('/queue/abort'); }
/** * Tests Stomp->abort() */ public function testAbort() { $this->Stomp->getConnection()->setReadTimeout(3); if (!$this->Stomp->isConnected()) { $this->Stomp->connect(); } $this->simpleStomp->begin("tx1"); $this->assertTrue($this->Stomp->send($this->queue, 'testSend', ["transaction" => "tx1"])); $this->simpleStomp->abort("tx1"); $this->simpleStomp->subscribe($this->queue, 'mysubid'); $frame = $this->Stomp->readFrame(); $this->assertFalse($frame); $this->simpleStomp->unsubscribe($this->queue, 'mysubid'); $this->Stomp->disconnect(); }
public function testGetConnectionReturnsUsedConnection() { $connection = new Connection('tcp://myhost'); $stomp = new Client($connection); $this->assertSame($connection, $stomp->getConnection(), 'getConnection must return passed connection instance.'); }