Files
izyim-api/tests/Unit/WarehouseReceiveNoteTest.php
T
Zain Fauzan Rofie Azizi c43643c00f post test
2018-05-30 11:28:28 +08:00

93 lines
2.6 KiB
PHP

<?php
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
class WarehouseReceiveNoteTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testGET()
{
$response = $this->json('GET', '/api/warehousearr');
$response->assertStatus(200);
}
public function testPOST()
{
$response = $this->json('POST', '/api/warehousearr',
[
'so_id'=> '3',
'receive_on'=> '2018-03-01',
'transport_company_name'=> 'TEScief',
'consignment_note_no'=> '3',
'warehouse_receive_note_no'=> '3',
'receiving_person'=> 'TEST',
'marking_number'=> '3',
'image'=> 'test.jpg',
'warehouseitem' => [
0 => [
'description'=> 'CIEFhuhuuh',
'nominal_ctn'=> '1',
'actual_ctn'=> '1',
'nominal_measurement'=> '1',
'actual_measurement'=> '1',
'nominal_weight'=> '1',
'actual_weight'=> '1',
'balance'=> '2',
'isDamaged'=> '1',
'status'=> 'ok',
'image'=> 'test.jpg',
'wa_id'=> '4',
'soitem_id'=> '4'
],
1 => [
'description'=> 'CIEFhuhuuh',
'nominal_ctn'=> '1',
'actual_ctn'=> '1',
'nominal_measurement'=> '1',
'actual_measurement'=> '1',
'nominal_weight'=> '1',
'actual_weight'=> '1',
'balance'=> '2',
'isDamaged'=> '1',
'status'=> 'ok',
'image'=> 'test.jpg',
'wa_id'=> '4',
'soitem_id'=> '4'
]
]
]);
dd($response->getContent());
// $response->assertStatus(201);
}
// public function testUploadWarehouseImage()
// {
// Storage::fake('warehouse_picture');
// $response = $this->actingAs($this->user)
// ->json('POST', '/warehousearr/warehouse_picture/{wa_id}', [
// 'warehouse_picture' => UploadedFile::fake()->image('comp.jpg')
// ]);
// // dd($response->getContent());
// $response->assertStatus(201);
// }
}