fix merge problem, create factory, fix controller problem in SO and WRN, setup a testing database

This commit is contained in:
Zain Fauzan Rofie Azizi
2018-05-31 15:59:59 +08:00
17 changed files with 658 additions and 25 deletions
+26 -14
View File
@@ -7,6 +7,9 @@ use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use App\Warehousearr;
use App\Warehouseitem;
use Artisan;
class WarehouseReceiveNoteTest extends TestCase
@@ -16,13 +19,13 @@ class WarehouseReceiveNoteTest extends TestCase
*
* @return void
*/
public function testGET()
{
$response = $this->json('GET', '/api/warehousearr');
// public function testGET()
// {
// $response = $this->json('GET', '/api/warehousearr');
$response->assertStatus(200);
// $response->assertStatus(200);
}
// }
public function testPOST()
{
@@ -51,11 +54,10 @@ class WarehouseReceiveNoteTest extends TestCase
'isDamaged'=> '1',
'status'=> 'ok',
'image'=> 'test.jpg',
'wa_id'=> '4',
'soitem_id'=> '4'
'wa_id'=> '11',
],
1 => [
'description'=> 'CIEFhuhuuh',
'description'=> 'CIE',
'nominal_ctn'=> '1',
'actual_ctn'=> '1',
'nominal_measurement'=> '1',
@@ -66,14 +68,13 @@ class WarehouseReceiveNoteTest extends TestCase
'isDamaged'=> '1',
'status'=> 'ok',
'image'=> 'test.jpg',
'wa_id'=> '4',
'soitem_id'=> '4'
'wa_id'=> '11',
]
]
]);
dd($response->getContent());
// $response->assertStatus(201);
// dd($response->getContent());
$response->assertStatus(201);
}
@@ -120,12 +121,23 @@ class WarehouseReceiveNoteTest extends TestCase
// Storage::fake('warehouse_picture');
// $response = $this->actingAs($this->user)
// ->json('POST', '/warehousearr/warehouse_picture/{wa_id}', [
// 'warehouse_picture' => UploadedFile::fake()->image('comp.jpg')
// ->json('POST', '/warehousearr/warehouse_picture/1', [
// 'warehouse_picture' => UploadedFile::fake()->image('test.jpg')
// ]);
// // dd($response->getContent());
// $response->assertStatus(201);
// }
// public function testUploadWarehouseItemImage()
// {
// Storage::fake('warehouse_picture');
// $response = $this->actingAs($this->user)
// ->json('POST', '/warehousearr/warehouse_item_picture/1', [
// 'warehouse_item_picture' => UploadedFile::fake()->image('test.jpg')
// ]);
// // dd($response->getContent());
// $response->assertStatus(201);
// }
}