Skip to content

Commit

Permalink
fix: temporary fix with third party call api
Browse files Browse the repository at this point in the history
  • Loading branch information
gvieira18 committed Aug 18, 2024
1 parent 50df1ff commit 3bdbb5e
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace Tests\Feature\Http\Controllers\Api\V1;

use App\Clients\Consumer\ConsumerClient;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class AuthenticatedUserControllerTest extends TestCase
{
use DatabaseMigrations;
use RefreshDatabase;

protected function setUp(): void
{
Expand All @@ -19,8 +20,19 @@ public function testPutSettings()
{
// Arrange
$this->artisan('db:seed');
$user = User::factory()
->create();
$user = User::factory()->create();

/**
* I don't think the right way would be to run a docker compose with
* the Rust + ScyllaDB (and also Postgres, Redis) just to run the tests,
* at the same time I'm not a php dev, so there may well be a better solution for this.
*/
$this->partialMock(ConsumerClient::class, function ($mock) use ($user) {
$mock->shouldReceive('updateUser')
->once()
->with($user)
->andReturn(true);
});

$user->accounts()->create([
'provider' => 'twitch',
Expand Down

0 comments on commit 3bdbb5e

Please sign in to comment.