Add quick registration test for CAPI. #288

This commit is contained in:
Korina Cordero 2019-12-16 04:05:04 +00:00
parent e62c3dc097
commit 9c9018171e
2 changed files with 22 additions and 15 deletions

View file

@ -55,14 +55,20 @@ class TestAPICommand extends Command
'last_name' => 'Last', 'last_name' => 'Last',
'mobile_number' => '12345678910', 'mobile_number' => '12345678910',
]; ];
$api->post('/capi/warranties', $params); //$api->post('/capi/warranties', $params);
// get all warranties // get all warranties
$api->get('/capi/warranties'); $params = [
'order' => 'DESC',
'limit' => '5',
'start' => '1',
];
$api->get('/capi/warranties', $params);
// warranty find // warranty find
$api->get('/capi/warranties/' . $serial); //$api->get('/capi/warranties/' . $serial);
// warranty update // warranty update
$id = 86811; $id = 86811;
@ -77,7 +83,7 @@ class TestAPICommand extends Command
'last_name' => 'Last', 'last_name' => 'Last',
'mobile_number' => '123456789111', 'mobile_number' => '123456789111',
]; ];
$api->post('/capi/warranties/'. $id, $params); //$api->post('/capi/warranties/'. $id, $params);
// warranty set privacy policy // warranty set privacy policy
$id = 86811; $id = 86811;
@ -85,7 +91,7 @@ class TestAPICommand extends Command
$params = [ $params = [
'privacy_policy_id' => $policy_id, 'privacy_policy_id' => $policy_id,
]; ];
$api->post('/capi/warranties/' . $id .'/privacypolicy', $params); //$api->post('/capi/warranties/' . $id .'/privacypolicy', $params);
// warranty claim // warranty claim
$id = 86811; $id = 86811;
@ -93,27 +99,27 @@ class TestAPICommand extends Command
$params = [ $params = [
'serial' => $serial, 'serial' => $serial,
]; ];
$api->post('/capi/warranties/' . $id . '/claim', $params); //$api->post('/capi/warranties/' . $id . '/claim', $params);
// warranty cancel // warranty cancel
$id = 86811; $id = 86811;
$api->get('/capi/warranties/' . $id . '/cancel'); //$api->get('/capi/warranties/' . $id . '/cancel');
// plate warranty // plate warranty
$api->get('/capi/plates/' . $plate_num . '/warranties'); //$api->get('/capi/plates/' . $plate_num . '/warranties');
// warranty delete // warranty delete
$id = 86811; $id = 86811;
$api->post('/capi/warranties/' . $id . '/delete'); //$api->post('/capi/warranties/' . $id . '/delete');
// battery // battery
$api->get('/capi/battery_brands'); //$api->get('/capi/battery_brands');
$api->get('/capi/battery_sizes'); //$api->get('/capi/battery_sizes');
$api->get('/capi/batteries'); //$api->get('/capi/batteries');
// vehicle // vehicle
$api->get('/capi/vehicle_manufacturers'); //$api->get('/capi/vehicle_manufacturers');
$api->get('/capi/vehicles'); //$api->get('/capi/vehicles');
// privacy policy // privacy policy
$privacy_policy_id = 2; $privacy_policy_id = 2;

View file

@ -603,7 +603,8 @@ class WarrantyController extends Controller
} }
} }
else else
{ {
// what if serial exists but plate number is different?
// new warranty // new warranty
$warranty = new Warranty(); $warranty = new Warranty();