mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
add file checking in bookingtest. optimize some code.
This commit is contained in:
@@ -23,7 +23,7 @@ class BookingTest extends TestCase
|
||||
{
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
$this->user = User::Find(1);
|
||||
$this->user = factory(User::class)->create();
|
||||
}
|
||||
|
||||
public function testPost()
|
||||
@@ -61,11 +61,15 @@ class BookingTest extends TestCase
|
||||
|
||||
public function testuploadbankslip()
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
$this->actingAs($this->user);
|
||||
Storage::fake('bankslip_url');
|
||||
$bankslip_url = UploadedFile::fake()->image('comp.jpg');
|
||||
if(!file_exists($bankslip_url)){
|
||||
$response->assertStatus(400);
|
||||
}
|
||||
|
||||
$response = $this->json('POST', '/api/booking/1/upload-user-bankslip', [
|
||||
'bankslip_url' => UploadedFile::fake()->image('comp.jpg'),
|
||||
'bankslip_url' => $bankslip_url,
|
||||
'transfer_amount' => '9000'
|
||||
]);
|
||||
$response->assertStatus(200);
|
||||
@@ -75,6 +79,10 @@ class BookingTest extends TestCase
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
Storage::fake('image_url');
|
||||
$image_url = UploadedFile::fake()->image('comp.jpg');
|
||||
if(!file_exists($image_url)){
|
||||
$response->assertStatus(400);
|
||||
}
|
||||
|
||||
$response = $this->json('POST', '/api/booking/1/upload-po', [
|
||||
'image_url' => UploadedFile::fake()->image('comp.jpg'),
|
||||
|
||||
Reference in New Issue
Block a user