clqms-be/tests/feature/Patients/PatientDeleteTest.php
2025-09-23 10:18:48 +07:00

49 lines
1.3 KiB
PHP

<?php
namespace Tests\Feature\Patient;
use CodeIgniter\Test\FeatureTestTrait;
use CodeIgniter\Test\CIUnitTestCase;
class PatientDeleteTest extends CIUnitTestCase
{
use FeatureTestTrait;
// public function testDeleteFail() {
// $payload = [
// 'InternalPID' => 9999999
// ];
// $result = $this->withBodyFormat('json')
// ->withBody(json_encode($payload))
// ->delete('api/patient');
// $result->assertStatus(404);
// $json = $result->getJSON(); // bentuk string JSON
// $json = json_decode($json, true);
// $result->assertJSONFragment([
// 'status' => 404,
// 'error' => 404
// ]);
// }
// public function testDeleteSuccess() {
// $payload = [
// 'InternalPID' => 2
// ];
// $result = $this->withBodyFormat('json')
// ->withBody(json_encode($payload))
// ->delete('api/patient');
// $result->assertStatus(200);
// $json = $result->getJSON(); // bentuk string JSON
// $json = json_decode($json, true);
// // $this->assertSame('Patient with ID 999999 not found.', $json['message']);
// $result->assertJSONFragment([
// 'status' => 'success'
// ]);
// }
}