forked from Vonage/vonage-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestNoVonageConfiguration.php
38 lines (33 loc) · 1.08 KB
/
TestNoVonageConfiguration.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;
class TestNoVonageConfiguration extends AbstractTestCase
{
/**
* Define environment setup.
*
* @param Application $app
*
* @return void
*/
protected function getEnvironmentSetUp($app): void
{
$app['config']->set('vonage.api_key', 'my_api_key');
}
/**
* Test that when we do not supply Vonage configuration
* a Runtime exception is generated under the Vonage namespace.
*
* @dataProvider classNameProvider
*
* @param $className
*
* @return void
*/
public function testWhenNoConfigurationIsGivenExceptionIsRaised($className): void
{
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('Please provide Vonage API credentials. Possible combinations: api_key + api_secret, api_key + signature_secret, private_key + application_id, api_key + api_secret + private_key + application_id, api_key + signature_secret + private_key + application_id');
app($className);
}
}