Longman\TelegramBot\Tests\Unit\TestHelpers::getFakeRecordedAudio PHP Метод

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

Get fake recorded audio track
public static getFakeRecordedAudio ( ) : array
Результат array
    public static function getFakeRecordedAudio()
    {
        $mime_type = ['audio/ogg', 'audio/mpeg', 'audio/vnd.wave', 'audio/x-ms-wma', 'audio/basic'];
        $data = ['file_id' => mt_rand(1, 999), 'duration' => (string) mt_rand(1, 99) . ':' . mt_rand(1, 60), 'performer' => 'phpunit', 'title' => 'track from phpunit', 'mime_type' => $mime_type[array_rand($mime_type, 1)], 'file_size' => mt_rand(1, 99999)];
        return $data;
    }

Usage Example

Пример #1
0
 /**
  * Set Up
  */
 public function setUp()
 {
     $this->record = TestHelpers::getFakeRecordedAudio();
 }