From 35d467bf2c16141af43d71909dcfd29d2849b711 Mon Sep 17 00:00:00 2001 From: Marco Scapolo Date: Fri, 20 Sep 2024 14:46:02 +0200 Subject: [PATCH] fix: Messages list test fixed --- tests/Unit/Messages/MessagesTest.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/Unit/Messages/MessagesTest.php b/tests/Unit/Messages/MessagesTest.php index e02a876..0e21484 100644 --- a/tests/Unit/Messages/MessagesTest.php +++ b/tests/Unit/Messages/MessagesTest.php @@ -3,6 +3,7 @@ namespace Offlineagency\LaravelWebex\Tests\Unit\Messages; use Illuminate\Support\Facades\Http; +use Offlineagency\LaravelWebex\Entities\Messages\Messages; use Offlineagency\LaravelWebex\LaravelWebex; use Offlineagency\LaravelWebex\Tests\Fake\Messages\MessagesFakeResponse; use Offlineagency\LaravelWebex\Tests\TestCase; @@ -12,7 +13,7 @@ class MessagesTest extends TestCase public function test_messages_list() { Http::fake([ - 'messages' => Http::response( + 'https://webexapis.com/v1/messages*' => Http::response( (new MessagesFakeResponse())->getMessagesFakeList() ), ]); @@ -20,6 +21,15 @@ public function test_messages_list() $laravel_webex = new LaravelWebex(); $messages_list = $laravel_webex->messages()->list('fake_id'); - dd($messages_list); + $this->assertCount(2, $messages_list); + + $single_message = null; + + foreach ($messages_list as $message) { + $this->assertInstanceOf(Messages::class, $message); + $single_message = $message; + } + + $this->assertEquals('fake_id', $single_message->id); } }