From aeb1789a608b5aec567d024c0373d50e28a010b5 Mon Sep 17 00:00:00 2001 From: Mike Hamer Date: Tue, 12 Oct 2021 16:33:36 -0400 Subject: [PATCH] Update messaging media id to be unique --- tests/ApiTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 9554a96..0f0af7a 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -60,20 +60,20 @@ public function testCreateMessageInvalidPhoneNumber() { public function testUploadDownloadMedia() { //constants - - $mediaFileName = "php-monitoring"; - $mediaFile = "12345"; //todo: confirm binary string? + $mediaId = "text-media-id-" . uniqid(); + $content = "Hello world"; + //media upload - $this->bandwidthClient->getMessaging()->getClient()->uploadMedia(getenv("BW_ACCOUNT_ID"), $mediaFileName, $mediaFile); + $this->bandwidthClient->getMessaging()->getClient()->uploadMedia(getenv("BW_ACCOUNT_ID"), $mediaId, $content); //media download - $downloadedMediaFile = $this->bandwidthClient->getMessaging()->getClient()->getMedia(getenv("BW_ACCOUNT_ID"), $mediaFileName)->getResult(); + $downloadedContent = $this->bandwidthClient->getMessaging()->getClient()->getMedia(getenv("BW_ACCOUNT_ID"), $mediaId)->getResult(); //media delete - $deleteMedaiFile = $this->bandwidthClient->getMessaging()->getClient()->deleteMedia(getenv("BW_ACCOUNT_ID"), $mediaFileName); + $this->bandwidthClient->getMessaging()->getClient()->deleteMedia(getenv("BW_ACCOUNT_ID"), $mediaId); //validate that response is the same - $this->assertEquals($downloadedMediaFile, $mediaFile); + $this->assertEquals($downloadedContent, $content); } public function testCreateCallAndGetCallState() {