mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 20:44:04 +00:00
f21c6c9ded
added delivery info index to show lists of delivery info for the company fixed delivery info show security
85 lines
2.0 KiB
PHP
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);
|
|
// }
|
|
|
|
|
|
}
|