-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autoload video module if it is installed (#458)
- Loading branch information
1 parent
5021494
commit 2c8d6b4
Showing
2 changed files
with
64 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/** | ||
* Vonage Client Library for PHP | ||
* | ||
* @copyright Copyright (c) 2016-2023 Vonage, Inc. (http://vonage.com) | ||
* @license https://github.com/Vonage/vonage-php-sdk-core/blob/master/LICENSE.txt Apache License 2.0 | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VonageTest; | ||
|
||
use RuntimeException; | ||
use VonageTest\VonageTestCase; | ||
use Vonage\Client; | ||
use Vonage\Client\Credentials\Basic; | ||
|
||
class ClientTest extends VonageTestCase | ||
{ | ||
/** | ||
* Make sure that when calling the video module it errors if the class isn't found | ||
*/ | ||
public function testCallingVideoWithoutPackageGeneratesRuntimeError(): void | ||
{ | ||
$this->expectException(RuntimeException::class); | ||
$this->expectExceptionMessage('Please install @vonage/video to use the Video API'); | ||
|
||
$client = new Client(new Basic('abcd', '1234')); | ||
$video = $client->video(); | ||
} | ||
} |