39 lines
909 B
PHP
39 lines
909 B
PHP
<?php
|
|
|
|
namespace Tests\App\Models;
|
|
|
|
use Tests\Support\ModelCrudTestCase;
|
|
use App\Models\PaymentModel;
|
|
use CodeIgniter\Model;
|
|
|
|
class PaymentModelTest extends ModelCrudTestCase
|
|
{
|
|
protected function fabricatorOverrides(Model $model): array
|
|
{
|
|
$overrides = parent::fabricatorOverrides($model);
|
|
|
|
if ($model instanceof PaymentModel) {
|
|
$overrides['transaction_id'] = uniqid('PAY-TEST-', true);
|
|
$overrides['payment_method'] = 'cash';
|
|
$overrides['status'] = 'recorded';
|
|
}
|
|
|
|
return $overrides;
|
|
}
|
|
|
|
public function testCanInsertAndRetrieve()
|
|
{
|
|
$this->assertModelCanInsertAndRetrieve(PaymentModel::class);
|
|
}
|
|
|
|
public function testCanUpdate()
|
|
{
|
|
$this->assertModelCanUpdate(PaymentModel::class);
|
|
}
|
|
|
|
public function testCanDelete()
|
|
{
|
|
$this->assertModelCanDelete(PaymentModel::class);
|
|
}
|
|
}
|