fix financial issues

This commit is contained in:
root
2026-06-01 02:08:27 -04:00
parent 090cb88573
commit 6444b61416
56 changed files with 4196 additions and 1824 deletions
@@ -0,0 +1,19 @@
<?php
namespace Tests\App\Models;
use App\Models\PaymentModel;
use CodeIgniter\Test\CIUnitTestCase;
class PaymentModelMetadataTest extends CIUnitTestCase
{
public function testAllowedFieldsIncludeInstallmentSequence(): void
{
$model = new PaymentModel();
$fields = self::getPrivateProperty($model, 'allowedFields');
$this->assertContains('installment_seq', $fields);
$this->assertContains('transaction_id', $fields);
$this->assertContains('check_file', $fields);
}
}
@@ -1,40 +0,0 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\PaypalTransactionModel;
class PaypalTransactionModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(PaypalTransactionModel::class);
$this->assertNotNull($record->id);
$fetched = (new PaypalTransactionModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(PaypalTransactionModel::class);
$model = new PaypalTransactionModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(PaypalTransactionModel::class);
$model = new PaypalTransactionModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}