Skip to content

Commit

Permalink
fix: Messages list test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoScapolo committed Sep 20, 2024
1 parent a76b85d commit 35d467b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/Unit/Messages/MessagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -12,14 +13,23 @@ class MessagesTest extends TestCase
public function test_messages_list()
{
Http::fake([
'messages' => Http::response(
'https://webexapis.com/v1/messages*' => Http::response(
(new MessagesFakeResponse())->getMessagesFakeList()
),
]);

$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);
}
}

0 comments on commit 35d467b

Please sign in to comment.