mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-25 15:24:21 +00:00
add logic, test
This commit is contained in:
+66
-16
@@ -38,28 +38,78 @@ class BookingTest extends TestCase
|
||||
'swift_code' => '123wert',
|
||||
'cnap' => '2131rew',
|
||||
'term' => 'x2_cash',
|
||||
'amount' => '14000'
|
||||
'amount' => '14000',
|
||||
'rmb_book_amount' => '2131',
|
||||
'rmb_book_pay_method' => '2131rea',
|
||||
'rmb_book_account_name' => '2131rew',
|
||||
'rmb_book_acc_no' => '2131',
|
||||
'rmb_book_bank_branch' => '2131rew',
|
||||
'usd_book_amount' => '2131',
|
||||
'usd_book_pay_method' => '2131rew',
|
||||
'usd_book_company_name' => '2131rew',
|
||||
'usd_book_company_address' => '2131rew',
|
||||
'usd_book_swift_code' => '2131rew',
|
||||
'usd_book_cnap' => '2131rew',
|
||||
'usd_book_bank_branch' => '2131rew',
|
||||
'verification_status' => '1'
|
||||
]);
|
||||
$response->assertStatus(200);
|
||||
$response->assertStatus(201);
|
||||
}
|
||||
|
||||
public function testImageUpload()
|
||||
{
|
||||
Storage::fake('bankslip_url');
|
||||
|
||||
$response = $this->json('POST', '/api/upload-bs', [
|
||||
public function testuploadbankslip()
|
||||
{
|
||||
Storage::fake('bankslip_url');
|
||||
|
||||
$response = $this->json('POST', '/api/booking/1/upload-user-bankslip', [
|
||||
'bankslip_url' => UploadedFile::fake()->image('comp.jpg'),
|
||||
'bank_slip_type' => '',
|
||||
'transfer_amount' => '1000',
|
||||
'book_id' => '1',
|
||||
'cust_marking' => '12345',
|
||||
'is_approve' => '1',
|
||||
'transfer_amount' => '12345'
|
||||
]);
|
||||
dd($response->getContent());
|
||||
$response->assertStatus(201);
|
||||
}
|
||||
|
||||
]);
|
||||
//var_dump($response);
|
||||
dd($response->getContent());
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
public function testuploadPO()
|
||||
{
|
||||
Storage::fake('image_url');
|
||||
|
||||
$response = $this->json('POST', '/api/booking/1/upload-po', [
|
||||
'image_url' => UploadedFile::fake()->image('comp.jpg'),
|
||||
'amount' => '12345'
|
||||
]);
|
||||
dd($response->getContent());
|
||||
$response->assertStatus(201);
|
||||
}
|
||||
|
||||
|
||||
// function upload_bankslip_test()
|
||||
// {
|
||||
// Storage::fake('public');
|
||||
//
|
||||
// $this->json('post', '/api/booking/1/upload-user-bankslip', [
|
||||
// 'bankslip_url' => $file = UploadedFile::fake()->image('random.jpg'),
|
||||
// 'transfer_amount' => '12345',
|
||||
// ]);
|
||||
//
|
||||
// $this->assertEquals('file/' . $file->hashName(), Upload::latest()->first()->file);
|
||||
//
|
||||
// Storage::disk('public')->assertExists('file/' . $file->hashName());
|
||||
//
|
||||
// }
|
||||
//
|
||||
// function upload_po_test()
|
||||
// {
|
||||
// Storage::fake('public');
|
||||
//
|
||||
// $this->json('post', '/api/booking/1/upload-po', [
|
||||
// 'image_url' => $file = UploadedFile::fake()->image('random.jpg'),
|
||||
// 'amount' => '12345',
|
||||
// ]);
|
||||
//
|
||||
// $this->assertEquals('file/' . $file->hashName(), Upload::latest()->first()->file);
|
||||
//
|
||||
// Storage::disk('public')->assertExists('file/' . $file->hashName());
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user