forked from Vonage/vonage-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestClientBasicAPICredentials.php
38 lines (33 loc) · 1.1 KB
/
TestClientBasicAPICredentials.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Vonage\Laravel\Tests;
use Illuminate\Foundation\Application;
use Vonage\Client;
class TestClientBasicAPICredentials extends AbstractTestCase
{
/**
* Define environment setup.
*
* @param Application $app
*
* @return void
*/
protected function defineEnvironment($app): void
{
$app['config']->set('vonage.api_key', 'my_api_key');
$app['config']->set('vonage.api_secret', 'my_secret');
}
/**
* Test that our Vonage client is created with
* the Basic API credentials.
*
* @return void
*/
public function testClientCreatedWithBasicAPICredentials(): void
{
$client = app(Client::class);
$credentialsObject = $this->getClassProperty(Client::class, 'credentials', $client);
$credentialsArray = $this->getClassProperty(Client\Credentials\Basic::class, 'credentials', $credentialsObject);
$this->assertInstanceOf(Client\Credentials\Basic::class, $credentialsObject);
$this->assertEquals(['api_key' => 'my_api_key', 'api_secret' => 'my_secret'], $credentialsArray);
}
}