11<?php
22/**
3- *
43 * This file is part of the Tidal/WampWatch package.
54 * (c) 2016 Timo Michna <timomichna/yahoo.de>
65 * *
76 * For the full copyright and license information, please view the LICENSE
87 * file that was distributed with this source code.
9- *
108 */
119
1210namespace integration \crossbar ;
1311
14- require_once realpath (__DIR__ . " /../.. " ) . " /bootstrap.php " ;
15- require_once __DIR__ . " /CrossbarTestingTrait.php " ;
12+ require_once realpath (__DIR__ . ' /../.. ' ) . ' /bootstrap.php ' ;
13+ require_once __DIR__ . ' /CrossbarTestingTrait.php ' ;
1614
1715use Thruway \ClientSession ;
1816use Thruway \Message \SubscribedMessage ;
2321
2422class CrosssbarSubscriptionMonitorTest extends \PHPUnit_Framework_TestCase
2523{
26-
2724 use CrossbarTestingTrait;
2825
2926 const REALM_NAME = 'realm1 ' ;
@@ -72,7 +69,6 @@ public function setup()
7269 public function test_onstart ()
7370 {
7471 $ this ->getConnection ()->on ('open ' , function () {
75-
7672 $ this ->subscriptionMonitor ->on ('start ' , [$ this ->subscriptionMonitor , 'stop ' ]);
7773
7874 $ this ->subscriptionMonitor ->start ();
@@ -90,15 +86,13 @@ public function test_onstart_delivers_current_list()
9086 // create an additional client session
9187 $ clientConnection = $ this ->createClientConnection ();
9288 $ clientConnection ->on ('open ' , function () use (&$ subscriptionId , $ clientConnection ) {
93-
9489 $ this ->clientSession ->subscribe ($ this ->testTopicName , function () {
9590 })
9691 ->done (function (SubscribedMessage $ message ) use (&$ subscriptionId ) {
9792 $ subscriptionId = $ message ->getSubscriptionId ();
9893
9994 $ this ->getConnection ()->open ();
10095 });
101-
10296 });
10397
10498 $ this ->getConnection ()->on ('open ' , function () use ($ clientConnection ) {
@@ -149,7 +143,6 @@ public function test_oncreate()
149143 public function test_onsubscribe ()
150144 {
151145 $ this ->connection ->on ('open ' , function () {
152-
153146 $ this ->subscriptionMonitor ->on ('subscribe ' , function () {
154147 $ this ->subscriptionMonitor ->stop ();
155148 });
@@ -167,7 +160,6 @@ public function test_onsubscribe()
167160 });
168161
169162 $ this ->subscriptionMonitor ->start ();
170-
171163 });
172164
173165 $ this ->connection ->open ();
@@ -178,7 +170,6 @@ public function test_onsubscribe()
178170
179171 public function test_onunsubscribe ()
180172 {
181-
182173 $ sessionId = null ;
183174 $ subscriptionId = null ;
184175
@@ -206,15 +197,13 @@ public function test_onunsubscribe()
206197 });
207198
208199 $ this ->subscriptionMonitor ->on ('unsubscribe ' , function ($ sesId , $ subId ) use (&$ sessionId , &$ subscriptionId , $ clientConnection ) {
209-
210200 $ sessionId = $ sesId ;
211201 $ subscriptionId = $ subId ;
212202
213203 $ this ->subscriptionMonitor ->stop ();
214204 });
215205
216206 $ this ->subscriptionMonitor ->start ();
217-
218207 });
219208
220209 $ this ->connection ->open ();
@@ -264,7 +253,6 @@ public function test_ondelete()
264253 });
265254
266255 $ this ->subscriptionMonitor ->start ();
267-
268256 });
269257
270258 $ this ->connection ->open ();
@@ -307,5 +295,4 @@ private function validateSubscriptionInfo(stdClass $subscriptionInfo)
307295 $ this ->assertAttributeInternalType ('array ' , 'prefix ' , $ subscriptionInfo );
308296 $ this ->assertAttributeInternalType ('array ' , 'wildcard ' , $ subscriptionInfo );
309297 }
310-
311298}
0 commit comments