PHP 클래스 Longman\TelegramBot\Tests\Unit\TestHelpers

저자: Avtandil Kikabidze ([email protected])
파일 보기 프로젝트 열기: akalongman/php-telegram-bot 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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