nhance-enrollment/tests/unit/CheckDependentConflictTest.php

59 lines
1.8 KiB
PHP
Executable File

<?php
namespace App\Tests;
use CodeIgniter\Test\CIUnitTestCase;
use Config\App;
use Config\Services;
use Tests\Support\Libraries\ConfigReader;
// use App\Helpers\excel_util_helper;
use Kint\Kint;
class CheckDependentConflictTest extends CIUnitTestCase
{
public function testCheckDependentConflict()
{
helper('excel_util_helper');
// Sample family data
$family_data = [
[1, 'John Doe', '1970-01-01', 'male', 'self', 'Self'],
[2, 'Jane Doe', '1975-01-01', 'female', 'spouse', 'Spouse'],
[3, 'Alice Doe', '2000-01-01', 'female', 'daughter', 'Daughter'],
[4, 'Bob Doe', '2005-01-01', 'male', 'son', 'Son'],
[5, 'Peter Doe', '1950-01-01', 'male', 'father', 'Father'],
[6, 'Mary Doe', '1955-01-01', 'female', 'mother', 'Mother'],
[7, 'George Doe', '1945-01-01', 'male', 'father-in-law', 'Father-in-law'],
[8, 'Grace Doe', '1950-01-01', 'female', 'mother-in-law', 'Mother-in-law'],
];
// Sample policy terms
$policy_terms = [
'family_floater' => true,
'family_floaters' => [
'childrens' => 2,
'spouse' => 1,
'either-parents-pil' => 0,
'parents' => 2,
'parents-in-law' => 2,
],
];
// Sample action array
$actionArr = 'addition';
// Call the function
$result = check_dependent_conflict($family_data, $policy_terms, $actionArr);
Kint::dump($result);
// Assert that the status is true (no conflicts)
$this->assertTrue($result['status']);
}
// public function testIsNull()
// {
// $i = null;
// $this->assertTrue($i);
// }
}