mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 12:34:06 +00:00
143 lines
4.2 KiB
PHP
143 lines
4.2 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;
|
|
use App\Warehousearr;
|
|
use App\Warehouseitem;
|
|
use Artisan;
|
|
|
|
|
|
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'=> '11',
|
|
],
|
|
1 => [
|
|
'description'=> 'CIE',
|
|
'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'=> '11',
|
|
]
|
|
]
|
|
]);
|
|
|
|
// dd($response->getContent());
|
|
$response->assertStatus(201);
|
|
|
|
}
|
|
|
|
// public function testPUT()
|
|
// {
|
|
// $response = $this->json('PUT', '/api/warehousearr/30',
|
|
|
|
// [
|
|
|
|
// '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'
|
|
// ],
|
|
// ]
|
|
// ]);
|
|
|
|
// // dd($response->getContent());
|
|
// $response->assertStatus(201);
|
|
|
|
// }
|
|
|
|
// public function testUploadWarehouseImage()
|
|
// {
|
|
// Storage::fake('warehouse_picture');
|
|
|
|
// $response = $this->actingAs($this->user)
|
|
// ->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);
|
|
// }
|
|
|
|
} |