1
0
Fork 0
mirror of synced 2024-09-19 19:07:21 +12:00

Add scopes to function template

This commit is contained in:
Khushboo Verma 2024-08-08 19:15:00 +05:30
parent 5534c4fddb
commit caa234f140
2 changed files with 8 additions and 0 deletions

View file

@ -110,6 +110,13 @@ class TemplateFunction extends Model
'default' => [],
'example' => [],
'array' => true
])
->addRule('scopes', [
'type' => self::TYPE_STRING,
'description' => 'Function scopes.',
'default' => [],
'example' => 'users.read',
'array' => true,
]);
}

View file

@ -881,6 +881,7 @@ class FunctionsCustomClientTest extends Scope
$this->assertEquals($expectedTemplates[$i]['vcsProvider'], $templates['body']['templates'][$i]['vcsProvider']);
$this->assertEquals($expectedTemplates[$i]['runtimes'], $templates['body']['templates'][$i]['runtimes']);
$this->assertEquals($expectedTemplates[$i]['variables'], $templates['body']['templates'][$i]['variables']);
$this->assertEquals($expectedTemplates[$i]['scopes'], $templates['body']['templates'][$i]['scopes']);
}
$templates_offset = $this->client->call(Client::METHOD_GET, '/functions/templates', array_merge([