mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-27 08:24:11 +00:00
completed the testing for the wrn, fixing testing error for so
This commit is contained in:
@@ -8,6 +8,14 @@ use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
class ShippingorderTest extends TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
@@ -27,68 +35,14 @@ class ShippingorderTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testPOSTso()
|
||||
{
|
||||
$response = $this->json('POST', '/api/so',
|
||||
|
||||
[
|
||||
'id' => '1',
|
||||
'ff_id' => '1',
|
||||
'supplier_company_name' => 'Testing',
|
||||
'supplier_contact_person' => 'Testing',
|
||||
'supplier_contact_person_no' => '1234',
|
||||
'delivery_id' => '1',
|
||||
'warehouse_id' => '1',
|
||||
|
||||
'soitem' => [
|
||||
0 => [
|
||||
'so_id' => '1',
|
||||
'status' => '1',
|
||||
'order_id' => '1',
|
||||
'brand_no' => '1',
|
||||
'model_no' => '1',
|
||||
'item_code' => '1',
|
||||
'quantity_of_item' => '1',
|
||||
'uom' => 'test',
|
||||
'quantity_of_carton' => '1',
|
||||
'packaging_type' => 'Testing',
|
||||
'packaging_height' => '123',
|
||||
'packaging_width' => '123',
|
||||
'packaging_depth' => '123',
|
||||
'packaging_gross' => '123',
|
||||
'packaging_nett' => '123',
|
||||
],
|
||||
1 => [
|
||||
'so_id' => '1',
|
||||
'status' => '1',
|
||||
'order_id' => '1',
|
||||
'brand_no' => '1',
|
||||
'model_no' => '1',
|
||||
'item_code' => '1',
|
||||
'quantity_of_item' => '1',
|
||||
'uom' => 'test',
|
||||
'quantity_of_carton' => '1',
|
||||
'packaging_type' => 'Testing',
|
||||
'packaging_height' => '123',
|
||||
'packaging_width' => '123',
|
||||
'packaging_depth' => '123',
|
||||
'packaging_gross' => '123',
|
||||
'packaging_nett' => '123',
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
$response->assertStatus(201);
|
||||
}
|
||||
|
||||
public function testDELETEso()
|
||||
public function testDELETEso()
|
||||
{
|
||||
$response = $this->json('DELETE', '/api/so/8');
|
||||
|
||||
$response->assertStatus(204);
|
||||
}
|
||||
|
||||
public function testDELETEsoitem()
|
||||
public function testDELETEsoitem()
|
||||
{
|
||||
$response = $this->json('DELETE', '/api/so/soitem/3');
|
||||
|
||||
@@ -98,43 +52,34 @@ class ShippingorderTest extends TestCase
|
||||
public function testPUTso()
|
||||
{
|
||||
|
||||
|
||||
$response = $this->json('PUT', '/api/so/2', [
|
||||
|
||||
'id' => '1',
|
||||
'ff_id' => '1',
|
||||
'supplier_company_name' => 'Testinggggggggggggggggggggg',
|
||||
'supplier_company_name' => 'Testing',
|
||||
'supplier_contact_person' => 'Testing',
|
||||
'supplier_contact_person_no' => '1234',
|
||||
'delivery_id' => '1',
|
||||
'warehouse_id' => '1',
|
||||
|
||||
]);
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testPUTsoitem()
|
||||
{
|
||||
|
||||
|
||||
$response = $this->json('PUT', '/api/so/soitem/1', [
|
||||
|
||||
'so_id' => '2',
|
||||
'status' => '1',
|
||||
'order_id' => '2',
|
||||
'brand_no' => '2',
|
||||
'model_no' => '2',
|
||||
'item_code' => '2',
|
||||
'quantity_of_item' => '2',
|
||||
'uom' => 'test',
|
||||
'quantity_of_carton' => '2',
|
||||
'packaging_type' => 'Testinggggggggggggggggggg',
|
||||
'packaging_height' => '123',
|
||||
'packaging_width' => '123',
|
||||
'packaging_depth' => '123',
|
||||
'packaging_gross' => '123',
|
||||
'packaging_nett' => '123',
|
||||
'soitem' => [
|
||||
0 => [
|
||||
'so_id' => '2',
|
||||
'status' => '1',
|
||||
'order_id' => '2',
|
||||
'brand_no' => '2',
|
||||
'model_no' => '2',
|
||||
'item_code' => '2',
|
||||
'quantity_of_item' => '2',
|
||||
'uom' => 'test',
|
||||
'quantity_of_carton' => '2',
|
||||
'packaging_type' => 'Testing',
|
||||
'packaging_height' => '123',
|
||||
'packaging_width' => '123',
|
||||
'packaging_depth' => '123',
|
||||
'packaging_gross' => '123',
|
||||
'packaging_nett' => '123',
|
||||
],
|
||||
]
|
||||
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user