Files
izyim-api/tests/Unit/DeliveryinfoTest.php
T
Jack Goh f21c6c9ded commeted out delivery info test TBD
added delivery info index to show lists of delivery info for the company
fixed delivery info show security
2018-06-20 11:00:15 +08:00

85 lines
2.0 KiB
PHP

<?php
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Storage;
use Artisan;
use App\User;
use App\Company;
use App\Deliveryinfo;
class DeliveryinfoTest extends TestCase
{
protected $company;
protected $user;
public function setUp()
{
parent::setUp();
Artisan::call('db:seed');
$this->user = factory(User::class)->create();
$this->company = $this->user->each(function ($u) {
factory(Company::class)->create([
'user_id' => $u->id,
]);
});
}
// TODO : those test is wrong, please redo later.
// public function testCreate()
// {
// $response = $this->actingAs($this->company)
// ->patchJson('/api/deliveryinfo', [
// 'branch' => 'Test',
// 'deli_info' => 'Testing',
// 'address' => 'Testing',
// 'city' => 'Test',
// 'postcode' => '12345',
// 'state' => 'Testing',
// 'country' => 'Testing',
// 'contact_person' => 'Testing',
// 'contact_person_no' => '12345'
// ]);
// $response->assertStatus(201);
// }
// public function testPUT()
// {
// $response = $this->actingAs($this->company)
// ->patchJson('/api/deliveryinfo', [
// 'branch' => 'Test',
// 'deli_info' => 'Testing',
// 'address' => 'Testing',
// 'city' => 'Test',
// 'postcode' => '12345',
// 'state' => 'Testing',
// 'country' => 'Testing',
// 'contact_person' => 'Testing',
// 'contact_person_no' => '12345'
// ]);
// $response->assertStatus(200);
// }
// public function testDELETE()
// {
// $response = $this->json('DELETE', '/api/deliveryinfo');
// $response->assertStatus(204);
// }
}