devsofttech_hms_ci4/tests/unit/Abdm/AbdmTaskBoardBackfillTest.php
DevSoftTech Server fd10df43c3 fix(abdm): resolve ABHA address verification, field error extraction, and task board sync
- Fix empty string fallback in validateAbha and EAtriaBridgeConnector to properly extract healthIdNumber and real fullName from data payload
- Skip generic bridge envelope messages in extractBridgeErrorText to surface specific field rejections like loginHint
- Translate non-existent ABHA address errors to 'ABHA Address does not exist or was not found in the ABDM registry'
- Support both 14-digit ABHA numbers and ABHA addresses in Diagnosis publish and ABDM Task Board
- Prevent completed task duplication in lab/radiology backfill
- Add unit tests in AbhaOtpErrorHandlingTest and AbdmTaskBoardBackfillTest
2026-10-01 17:12:17 +05:30

29 lines
1.1 KiB
PHP

<?php
use App\Controllers\AbdmTaskBoard;
use CodeIgniter\Test\CIUnitTestCase;
final class AbdmTaskBoardBackfillTest extends CIUnitTestCase
{
public function testIsValidAbhaNumberAcceptsCleanAndFormattedAndAddress(): void
{
$controller = (new ReflectionClass(AbdmTaskBoard::class))->newInstanceWithoutConstructor();
$method = new ReflectionMethod(AbdmTaskBoard::class, 'isValidAbhaNumber');
$method->setAccessible(true);
// 14 digits clean
$this->assertTrue($method->invoke($controller, '91747451787143'));
// 14 digits with standard hyphens
$this->assertTrue($method->invoke($controller, '91-7474-5178-7143'));
// ABHA address
$this->assertTrue($method->invoke($controller, 'singhkeshav301976@sbx'));
$this->assertTrue($method->invoke($controller, 'patient@abdm'));
// Invalid cases
$this->assertFalse($method->invoke($controller, ''));
$this->assertFalse($method->invoke($controller, '0'));
$this->assertFalse($method->invoke($controller, '12345'));
$this->assertFalse($method->invoke($controller, 'invalid_address'));
}
}