Merge branch 'asif/contact' of gitlab.com:CIEFWorldwideSdnBhd/izyim-api into asif/warehouses

# Conflicts:
#	app/Http/Controllers/CompanyController.php
#	package-lock.json
#	routes/api.php
This commit is contained in:
Jack Goh
2018-06-20 11:32:02 +08:00
16 changed files with 368 additions and 23251 deletions
+31 -99
View File
@@ -10,111 +10,43 @@ use Illuminate\Foundation\Testing\WithoutMiddleware;
class contactTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicExample()
{
$response = $this->json('POST', '/api/contacts', ['ff_id' => '14']);
$response
->assertStatus(201);
// ->assertJson(
// [
// 'success' => true,
// 'message' => 'Success'
// //'response' => [
// // 'id' => $contacts->ff_id,
// // ]
// ]);
}
public function testGet()
// {
// $response = $this->json('GET', '/api/contacts');
//
// $response
// ->assertStatus(200);
//
// }
{
$response = $this->json('GET', '/api/company/search/cief');
$response
->assertStatus(200);
}
public function testStoreId()
{
$response = $this->get('/api/contacts');
$response->assertStatus(200);
}
// public function testUPdate()
// {
//
// $response = $this->json('PUT', '/api/warehouse/{war_id}' . $article->id, $payload, $headers)
// ->assertStatus(200)
// ->assertJson([
// 'id' => 1,
// 'title' => 'Lorem',
// 'body' => 'Ipsum'
// ]);
// }
// public function testPostWarehouse()
// {
// $response = $this->json('POST', '/api/warehouse', [
//
// 'address'=> '2d',
// 'city'=>'cj ',
// 'zip'=>' 123',
// 'state' =>' sl',
// 'contact_person' =>'asif ',
// 'contact_person_no' =>'1212122 ',
// 'branch'=>'yap ',
// 'country' =>' ba',
// 'company_id' =>'1212 '
//
//
//
//
//
//
// ]);
//
// $response
// ->assertStatus(201);
//// ->assertJson([
//// 'created' => true,
// // ]
// //);
// }
public function testPutWarehouse()
{
$response = $this->json('PUT', '/api/warehouse/6', [
'address'=> '2g',
'city'=>'cj ',
'zip'=>' 123',
'state' =>' sl',
'contact_person' =>'tuytguy',
'contact_person_no' =>'1212122 ',
'branch'=>'yap ',
'country' =>' ba',
'company_id' =>'1212 '
]);
$response = $this->json('POST', '/api/contacts', ['company_id' => '1'], $this->headers());
$response
->assertStatus(200);
// ->assertJson([
//
// ]
// );
->assertStatus(201);
}
// public function testDeleteContacts()
// {
//
// $response = $this->json('DELETE', '/api/contacts/1');
//
// $response
// ->assertStatus(204);
//
// }
public function testApprove()
{
$response = $this->json('POST', '/api/contacts/1/request', ['action' => 1]);
$response
->assertStatus(200);
}
}