PHP Classes

File: tests/ExampleTest.php

Recommend this page to a friend!
  Classes of Arda Günsüren   ElevenLabs Laravel   tests/ExampleTest.php   Download  
File: tests/ExampleTest.php
Role: Example script
Content type: text/plain
Description: Example script
Class: ElevenLabs Laravel
Generate speech from text using the ElevenLabs API
Author: By
Last change:
Date: 11 days ago
Size: 658 bytes
 

Contents

Class file image Download
<?php

describe
('Methods Unit Test', function () {
   
test('getModels() function', function () {
       
$models = \ArdaGnsrn\ElevenLabs\Facades\ElevenLabs::getModels();
       
expect($models)->toBeArray();
       
expect($models)->not->toBeEmpty();
    });
   
test('textToSpeech() function', function () {
       
$response = \ArdaGnsrn\ElevenLabs\Facades\ElevenLabs::textToSpeech('2EiwWnXFnvU5JabPnv8n', 'H');
       
expect($response)->toBeInstanceOf(\ArdaGnsrn\ElevenLabs\Responses\TextToSpeechResponse::class);

       
$response->saveFile('test.mp3');
       
expect(\Illuminate\Support\Facades\Storage::exists('test.mp3'))->toBeTrue();
    });
});