PHP Класс Longman\TelegramBot\Tests\Unit\TestHelpers

Автор: Avtandil Kikabidze ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$chat_template array Data template of a chat.
$user_template array Data template of a user.

Открытые методы

Метод Описание
emptyDB ( array $credentials ) Empty all tables for the passed database
getFakeChatObject ( array $data = [] ) : Chat Return a fake chat object.
getFakeMessageObject ( array $message_data = [], array $user_data = [], array $chat_data = [] ) : Message Return a fake message object using the passed ids.
getFakeRecordedAudio ( ) : array Get fake recorded audio track
getFakeUpdateCommandObject ( string $command_text ) : Update Return a fake command object for the passed command text
getFakeUpdateObject ( array $data = null ) : Update Return a simple fake Update object
getFakeUserObject ( array $data = [] ) : Longman\TelegramBot\Entities\User Return a fake user object.
setObjectProperty ( object $object, string $property, mixed $value ) Set the value of a private/protected property of an object
setStaticProperty ( string $class, string $property, mixed $value ) Set the value of a private/protected static property of a class
startFakeConversation ( ) : array Start a fake conversation for the passed command and return the randomly generated ids.

Описание методов

emptyDB() публичный статический Метод

Empty all tables for the passed database
public static emptyDB ( array $credentials )
$credentials array

getFakeChatObject() публичный статический Метод

Return a fake chat object.
public static getFakeChatObject ( array $data = [] ) : Chat
$data array Pass custom data array if needed
Результат Longman\TelegramBot\Entities\Chat

getFakeMessageObject() публичный статический Метод

Return a fake message object using the passed ids.
public static getFakeMessageObject ( array $message_data = [], array $user_data = [], array $chat_data = [] ) : Message
$message_data array Pass custom message data array if needed
$user_data array Pass custom user data array if needed
$chat_data array Pass custom chat data array if needed
Результат Longman\TelegramBot\Entities\Message

getFakeRecordedAudio() публичный статический Метод

Get fake recorded audio track
public static getFakeRecordedAudio ( ) : array
Результат array

getFakeUpdateCommandObject() публичный статический Метод

Return a fake command object for the passed command text
public static getFakeUpdateCommandObject ( string $command_text ) : Update
$command_text string
Результат Longman\TelegramBot\Entities\Update

getFakeUpdateObject() публичный статический Метод

Return a simple fake Update object
public static getFakeUpdateObject ( array $data = null ) : Update
$data array Pass custom data array if needed
Результат Longman\TelegramBot\Entities\Update

getFakeUserObject() публичный статический Метод

Return a fake user object.
public static getFakeUserObject ( array $data = [] ) : Longman\TelegramBot\Entities\User
$data array Pass custom data array if needed
Результат Longman\TelegramBot\Entities\User

setObjectProperty() публичный статический Метод

Set the value of a private/protected property of an object
public static setObjectProperty ( object $object, string $property, mixed $value )
$object object Object that contains the property
$property string Name of the property who's value we want to set
$value mixed The value to set to the property

setStaticProperty() публичный статический Метод

Set the value of a private/protected static property of a class
public static setStaticProperty ( string $class, string $property, mixed $value )
$class string Class that contains the static property
$property string Name of the property who's value we want to set
$value mixed The value to set to the property

startFakeConversation() публичный статический Метод

Start a fake conversation for the passed command and return the randomly generated ids.
public static startFakeConversation ( ) : array
Результат array

Описание свойств

$chat_template защищенное статическое свойство

Data template of a chat.
protected static array $chat_template
Результат array

$user_template защищенное статическое свойство

Data template of a user.
protected static array $user_template
Результат array