Fix tests for current_action memory in Request class.

parent 2499c613
...@@ -25,6 +25,12 @@ use Longman\TelegramBot\Request; ...@@ -25,6 +25,12 @@ use Longman\TelegramBot\Request;
*/ */
class ServerResponseTest extends TestCase class ServerResponseTest extends TestCase
{ {
protected function setUp()
{
// Make sure the current action in the Request class is unset.
TestHelpers::setStaticProperty(Request::class, 'current_action', null);
}
public function sendMessageOk() public function sendMessageOk()
{ {
return '{ return '{
...@@ -193,6 +199,7 @@ class ServerResponseTest extends TestCase ...@@ -193,6 +199,7 @@ class ServerResponseTest extends TestCase
public function getUserProfilePhotos() public function getUserProfilePhotos()
{ {
TestHelpers::setStaticProperty(Request::class, 'current_action', 'getUserProfilePhotos');
return '{ return '{
"ok":true, "ok":true,
"result":{ "result":{
...@@ -238,6 +245,7 @@ class ServerResponseTest extends TestCase ...@@ -238,6 +245,7 @@ class ServerResponseTest extends TestCase
public function getFile() public function getFile()
{ {
TestHelpers::setStaticProperty(Request::class, 'current_action', 'getFile');
return '{ return '{
"ok":true, "ok":true,
"result":{ "result":{
...@@ -301,6 +309,7 @@ class ServerResponseTest extends TestCase ...@@ -301,6 +309,7 @@ class ServerResponseTest extends TestCase
public function getStickerSet() public function getStickerSet()
{ {
TestHelpers::setStaticProperty(Request::class, 'current_action', 'getStickerSet');
return '{ return '{
"ok":true, "ok":true,
"result":{ "result":{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment