Skip to content

Commit

Permalink
Mock DB transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
daveearley committed Sep 22, 2024
1 parent 7584526 commit d1993f6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
use HiEvents\Services\Handlers\Order\DTO\CompleteOrderOrderDTO;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Queue;
use Mockery;
use Mockery\MockInterface;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Tests\TestCase;
use Illuminate\Database\Connection;

class CompleteOrderHandlerTest extends TestCase
{
Expand All @@ -43,6 +45,7 @@ protected function setUp(): void
Queue::fake();
Mail::fake();
Bus::fake();
DB::shouldReceive('transaction')->andReturnUsing(fn($callback) => $callback(Mockery::mock(Connection::class)));

$this->orderRepository = Mockery::mock(OrderRepositoryInterface::class);
$this->attendeeRepository = Mockery::mock(AttendeeRepositoryInterface::class);
Expand Down

0 comments on commit d1993f6

Please sign in to comment.