@@ -44,6 +44,14 @@ public static function setUpBeforeClass()
4444 ];
4545 }
4646
47+ /**
48+ * To test the live commands, act as if we're being called by Telegram.
49+ */
50+ protected function makeRequestValid ()
51+ {
52+ $ _SERVER ['REMOTE_ADDR ' ] = '149.154.167.197 ' ;
53+ }
54+
4755 public function testSetParameters ()
4856 {
4957 $ botManager = new BotManager (array_merge (ParamsTest::$ demo_vital_params , [
@@ -239,9 +247,11 @@ public function testValidateAndSetWebhookSuccessLiveBot()
239247
240248 /**
241249 * @group live
250+ * @runInSeparateProcess
242251 */
243252 public function testDeleteWebhookViaRunLiveBot ()
244253 {
254+ $ this ->makeRequestValid ();
245255 $ _GET = ['a ' => 'unset ' ];
246256 $ botManager = new BotManager (array_merge (self ::$ live_params , [
247257 'webhook ' => ['url ' => 'https://example.com/hook.php ' ],
@@ -438,20 +448,24 @@ public function testIsValidRequestValidate()
438448
439449 /**
440450 * @group live
451+ * @runInSeparateProcess
441452 */
442453 public function testGetUpdatesLiveBot ()
443454 {
455+ $ this ->makeRequestValid ();
444456 $ botManager = new BotManager (self ::$ live_params );
445457 $ output = $ botManager ->run ()->getOutput ();
446458 self ::assertContains ('Updates processed: 0 ' , $ output );
447459 }
448460
449461 /**
450462 * @group live
463+ * @runInSeparateProcess
451464 */
452465 public function testGetUpdatesLoopLiveBot ()
453466 {
454- // Webhook must NOT be set for this to work!
467+ $ this ->makeRequestValid ();
468+ // Webhook MUST NOT be set for this to work!
455469 $ this ->testDeleteWebhookViaRunLiveBot ();
456470
457471 // Looping for 5 seconds should be enough to get a result.
0 commit comments