Company Profile has been completed and tested

This commit is contained in:
Aqeeb Imtiaz Harun
2018-05-16 09:57:03 +08:00
parent 3d1509d784
commit f72645e2c2
2 changed files with 70 additions and 67 deletions
+49 -37
View File
@@ -20,50 +20,62 @@ class CompanyTest extends TestCase
$this->assertTrue(true);
}
// public function testPOST()
// {
// $response = $this->json('POST', '/api/company', [
// 'company_name'=>'testing',
// 'registration_no'=>'testing',
// 'tax_no'=>'testing',
// 'tel_no'=>'12345',
// 'fax'=>'12345',
// 'address'=>'testing',
// 'city'=>'testing',
// 'postcode'=>'testing',
// 'state'=>'testing',
// 'country'=>'testing',
// 'contact_person'=>'testing',
// ]);
// var_dump($response);
// $response->assertStatus(302);
// }
public function testPOST()
{
$response = $this->json('POST', '/api/company', [
'company_name'=>'testing',
'registration_no'=>'testing',
'tax_no'=>'testing',
'tel_no'=>'12345',
'fax'=>'12345',
'address'=>'testing',
'city'=>'testing',
'postcode'=>'testing',
'state'=>'testing',
'country'=>'testing',
'contact_person'=>'testing',
]);
var_dump($response);
$response->assertStatus(302); //here 302 as the page redirects
}
public function testPUT()
{
$response = $this->json('PUT', '/api/company/9', [
'company_name'=>'changed testing',
'registration_no'=>'testing',
'tax_no'=>'testing',
'tel_no'=>'12345',
'fax'=>'12345',
'address'=>'testing',
'city'=>'testing',
'postcode'=>'testing',
'state'=>'testing',
'country'=>'testing',
'contact_person'=>'testing',
]);
$response->assertStatus(200);
}
// public function testPUT()
// {
// $response = $this->json('PUT', '/api/company/4', [
// 'company_name'=>'changed testing',
// 'registration_no'=>'testing',
// 'tax_no'=>'testing',
// 'tel_no'=>'12345',
// 'fax'=>'12345',
// 'address'=>'testing',
// 'city'=>'testing',
// 'postcode'=>'testing',
// 'state'=>'testing',
// 'country'=>'testing',
// 'contact_person'=>'testing',
// ]);
// $response->assertStatus(200);
// }
public function testcompanyProfile()
{
Storage::fake('company_profile');
$response = $this->json('POST', '/company/company_profile/4', [
$response = $this->json('POST', '/api/company/company_profile/9', [
'company_profile' => UploadedFile::fake()->image('comp.jpg')
]);
var_dump($response);
dd($response->getContent());
$response->assertStatus(200);
}
public function testregCert()
{
Storage::fake('reg_cert');
$response = $this->json('POST', '/api/company/reg_cert/9', [
'reg_cert' => UploadedFile::fake()->image('reg.pdf')
]);
dd($response->getContent());
$response->assertStatus(200);
}
}