Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 2eee413

Browse files
committed
Bot may be able to unset the webhook now, fixes #36
1 parent c1a72ef commit 2eee413

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/Telegram/Methods/SetWebhook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class SetWebhook extends TelegramMethods
3737
* Optional. HTTPS url to send updates to. Use an empty string to remove webhook integration
3838
* @var string
3939
*/
40-
public $url = '';
40+
public $url;
4141

4242
/**
4343
* Optional. Upload your public key certificate so that the root certificate in use can be checked. See our
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ok":true,"result":true,"description":"Webhook was deleted"}

tests/Telegram/Methods/SetWebhookTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,18 @@ public function testSetWebhook()
5353
$this->assertInstanceOf(ResultBoolean::class, $result);
5454
$this->assertTrue($result->data);
5555
}
56+
57+
public function testUnsetWebhook()
58+
{
59+
$this->tgLog->specificTest = 'unset';
60+
61+
$setWebhook = new SetWebhook();
62+
$setWebhook->url = '';
63+
64+
/** @var ResultBoolean $result */
65+
$result = $this->tgLog->performApiRequest($setWebhook);
66+
67+
$this->assertInstanceOf(ResultBoolean::class, $result);
68+
$this->assertTrue($result->data);
69+
}
5670
}

0 commit comments

Comments
 (0)