Skip to content

Commit

Permalink
refactor: renamed "save" to "create" in OrderRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorTurraF committed Jan 21, 2024
1 parent b57c0b0 commit b25efd7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/Contracts/Repository/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function all(): array;

function existsById($sellerId): bool;

function save($input): Order;
function create($input): Order;

function findBySellerId($sellerId): array;

Expand Down
2 changes: 1 addition & 1 deletion core/Tests/Feature/CreateOrderUseCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testExecuteCreatesOrderWhenSellerExists()
$orderRepositoryMock = $this->createMock(OrderRepository::class);
$orderRepositoryMock
->expects($this->once())
->method('save')
->method('create')
->with($order)
->willReturn($order);

Expand Down
2 changes: 1 addition & 1 deletion core/UseCase/CreateOrderUseCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function execute($input): mixed
'payment_approved_at' => $input['payment_approved_at'],
]);

$createdOrder = $this->orderRepo->save($order);
$createdOrder = $this->orderRepo->create($order);

return $createdOrder->toArray();
}
Expand Down

0 comments on commit b25efd7

Please sign in to comment.