File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,33 @@ public function testSubscription()
157
157
$ this ->c ->wait (1 );
158
158
}
159
159
160
+ /**
161
+ * Test Queue Subscription command.
162
+ *
163
+ * @return void
164
+ */
165
+ public function testQueueSubscription ()
166
+ {
167
+ $ callback = function ($ message ) {
168
+ $ this ->assertNotNull ($ message );
169
+ $ this ->assertEquals ($ message , 'bar ' );
170
+ };
171
+
172
+ $ this ->c ->queueSubscribe ('foo ' , 'bar ' , $ callback );
173
+ $ this ->assertGreaterThan (0 , $ this ->c ->subscriptionsCount ());
174
+ $ subscriptions = $ this ->c ->getSubscriptions ();
175
+ $ this ->assertInternalType ('array ' , $ subscriptions );
176
+
177
+ $ this ->c ->publish ('foo ' , 'bar ' );
178
+ $ this ->assertEquals (1 , $ this ->c ->pubsCount ());
179
+ /*
180
+ $process = new BackgroundProcess('/usr/bin/php ./tests/Util/ClientServerStub.php ');
181
+ $process->run();
182
+ */
183
+ // time_nanosleep(1, 0);
184
+ $ this ->c ->wait (1 );
185
+ }
186
+
160
187
/**
161
188
* Test Request command.
162
189
*
You can’t perform that action at this time.
0 commit comments