-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetmerchantrevenueheadTest.php
More file actions
53 lines (50 loc) · 1.72 KB
/
GetmerchantrevenueheadTest.php
File metadata and controls
53 lines (50 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
use App\Models\User;
use Tests\TestCase;
class RevenueHeadControllerGetmerchantrevenueheadTest extends TestCase{
public function test_get_merchant_revenue_head_success(){
// Create a user and authenticate
$user = User::factory()->create();
$this->actingAs($user);
// Call api endpoint
$response = $this->getJson("/payment/revenue_head/merchant");
// Assert the response
$response->assertStatus(200)
->assertJsonStructure([
'data' => [
'id',
'type',
'settlementBank' => [
'id',
'merchant_id',
]
]
]);
}
public function test_get_merchant_revenue_head_failure(){
// Create a user and authenticate
$user = User::factory()->create();
$this->actingAs($user);
// Call api endpoint
$response = $this->getJson("/payment/revenue_head/merchant");
// Assert the response
$response->assertStatus(400);
}
public function test_get_merchant_revenue_head_unauthorized(){
// Create a user and authenticate
$user = User::factory()->create();
// Call api endpoint
$response = $this->getJson("/payment/revenue_head/merchant");
// Assert the response
$response->assertStatus(401);
}
public function test_get_merchant_revenue_head_invalid_route(){
// Create a user and authenticate
$user = User::factory()->create();
$this->actingAs($user);
// Call api endpoint
$response = $this->getJson("/payment/revenue_head/merchant/invalid");
// Assert the response
$response->assertStatus(404);
}
}