<?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');
        $columns = self::getPrivateProperty($model, 'paymentColumns');

        foreach (['installment_seq', 'transaction_id', 'check_file'] as $field) {
            if (in_array($field, $columns, true)) {
                $this->assertContains($field, $fields);
            } else {
                $this->assertNotContains($field, $fields);
            }
        }
    }
}
