File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 3535 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3636 */
3737class connector extends \local_ai_manager \base_connector {
38+ public const DEFAULT_GOOGLE_SYNTHESIZE_ENDPOINT = 'https://texttospeech.googleapis.com/v1/text:synthesize ' ;
39+
3840 #[\Override]
3941 protected function get_endpoint_url (): string {
40- return $ this ->instance ->get_endpoint () ?: ' https://texttospeech.googleapis.com/v1/text:synthesize ' ;
42+ return $ this ->instance ->get_endpoint () ?: self :: DEFAULT_GOOGLE_SYNTHESIZE_ENDPOINT ;
4143 }
4244
4345 #[\Override]
Original file line number Diff line number Diff line change 3131class instance extends base_instance {
3232 #[\Override]
3333 protected function extend_form_definition (\MoodleQuickForm $ mform ): void {
34- $ defaultendpoint = ' https://texttospeech.googleapis.com/v1/text:synthesize ' ;
34+ $ defaultendpoint = connector:: DEFAULT_GOOGLE_SYNTHESIZE_ENDPOINT ;
3535 $ insertat = $ mform ->elementExists ('useglobalapikey ' ) ? 'useglobalapikey ' : 'apikey ' ;
3636 $ mform ->insertElementBefore (
3737 $ mform ->createElement (
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ private function make_connector(string $endpoint): connector {
4646
4747 public function test_get_endpoint_url_returns_default_when_empty (): void {
4848 $ this ->assertEquals (
49- ' https://texttospeech.googleapis.com/v1/text:synthesize ' ,
49+ connector:: DEFAULT_GOOGLE_SYNTHESIZE_ENDPOINT ,
5050 $ this ->call_get_endpoint_url ($ this ->make_connector ('' ))
5151 );
5252 }
You can’t perform that action at this time.
0 commit comments