Skip to content

[MIT-3253] Create Http interface for executing API request#178

Merged
rosle merged 6 commits intomasterfrom
feature/MIT-3253-create-http-interface
Mar 28, 2025
Merged

[MIT-3253] Create Http interface for executing API request#178
rosle merged 6 commits intomasterfrom
feature/MIT-3253-create-http-interface

Conversation

@rosle
Copy link
Contributor

@rosle rosle commented Mar 27, 2025

Description

  • Create Http interface for API request
  • Reorganize unit test files in the project

More information

To make it easier to implement tests for API request, I did a quick update by extracting the executeCurl and executeTest to a new class with a new interface - OmiseHttpExecutorInterface. The logic for both functions remain unchanged.

API Mock Example

with Mockery:

$omiseHttpExecutorMock = Mockery::mock('overload:' . OmiseHttpExecutor::class);
$omiseHttpExecutorMock
  ->shouldReceive('execute')
  ->once()
  ->andReturn('<API Response>');

Also, I update the unit test directory by moving all tests inside unit folder:

Screenshot 2025-03-27 at 5 27 21 PM

Related links:

Rollback procedure

default rollback procedure

@rosle rosle marked this pull request as ready for review March 27, 2025 10:34
@rosle rosle merged commit 057f7fa into master Mar 28, 2025
12 checks passed
@rosle rosle deleted the feature/MIT-3253-create-http-interface branch March 28, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants