mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 04:24:01 +00:00
added unit testing
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicTest()
|
||||
{
|
||||
$response = $this->get('/');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Deliveryinfo;
|
||||
namespace Test\API;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
|
||||
class DeliveryinfoTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGET()
|
||||
{
|
||||
$response = $this->json('GET', '/api/company/deliveryinfo');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
// public function testPOST()
|
||||
// {
|
||||
// $response = $this->json('POST', '/api/company/com_id/deliveryinfo', [
|
||||
|
||||
// 'branch' => 'Testing',
|
||||
// 'deli_info' => 'Testing',
|
||||
// 'address' => 'Testing',
|
||||
// 'city' => 'Testing',
|
||||
// 'postcode' => '12345',
|
||||
// 'state' => 'Testing',
|
||||
// 'country' => 'Testing',
|
||||
// 'contact_person' => 'Testing',
|
||||
// 'contact_person_no' => '12345',
|
||||
|
||||
// ]);
|
||||
|
||||
// $response->assertStatus(201);
|
||||
// }
|
||||
|
||||
// public function testDELETE()
|
||||
// {
|
||||
// $response = $this->json('DELETE', '/api/company/4/deliveryinfo');
|
||||
|
||||
// $response->assertStatus(204);
|
||||
// }
|
||||
|
||||
public function testPUT()
|
||||
{
|
||||
|
||||
|
||||
$response = $this->json('PUT', '/api/company/1/deliveryinfo', [
|
||||
|
||||
//'id' => '1',
|
||||
'branch' => 'Ci',
|
||||
'deli_info' => 'Testing',
|
||||
'address' => 'Testing',
|
||||
'city' => 'Test',
|
||||
'postcode' => '12345',
|
||||
'state' => 'Testing',
|
||||
'country' => 'Testing',
|
||||
'contact_person' => 'Testing',
|
||||
'contact_person_no' => '12345'
|
||||
|
||||
]);
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicTest()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user