forked from stomp-php/stomp-php
-
Notifications
You must be signed in to change notification settings - Fork 1
/
QueueBrowserTest.php
41 lines (36 loc) · 1.09 KB
/
QueueBrowserTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/*
* This file is part of the Stomp package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Stomp\Tests\Unit\Broker\Apollo\Mode;
use PHPUnit\Framework\TestCase;
use Stomp\Broker\Apollo\Mode\QueueBrowser;
use Stomp\Broker\Exception\UnsupportedBrokerException;
use Stomp\Broker\RabbitMq\RabbitMq;
use Stomp\Client;
/**
* QueueBrowserTest
*
* @package Stomp\Tests\Unit\Broker\Apollo\Mode
* @author Jens Radtke <swefl.oss@fin-sn.de>
*/
class QueueBrowserTest extends TestCase
{
public function testBrowserWontWorkWithNonApolloBroker()
{
$client = $this->getMockBuilder(Client::class)
->disableOriginalConstructor()
->onlyMethods(['getProtocol'])
->getMock();
$client->method('getProtocol')->willReturn(new RabbitMq('client-id'));
/**
* @var $client Client
*/
$browser = new QueueBrowser($client, 'target');
$this->expectException(UnsupportedBrokerException::class);
$browser->subscribe();
}
}