add tests batch 20

This commit is contained in:
root
2026-06-09 01:03:53 -04:00
parent 95efb9652e
commit 6be4875c5e
1502 changed files with 13797 additions and 11313 deletions
@@ -26,7 +26,7 @@ class RefundDecisionServiceTest extends TestCase
'updated_at' => now(),
]);
$service = new RefundDecisionService;
$service = new RefundDecisionService();
$result = $service->approve(1, 2);
$this->assertTrue($result['ok']);
@@ -15,7 +15,7 @@ class RefundNotificationServiceTest extends TestCase
{
Log::spy();
$service = new RefundNotificationService;
$service = new RefundNotificationService();
$service->notifyPending(10, 50.25, 'https://example.test/login');
Log::shouldHaveReceived('info')->once();
@@ -45,7 +45,7 @@ class RefundOverpaymentServiceTest extends TestCase
'status' => 'Paid',
]);
$service = new RefundOverpaymentService(new RefundNotificationService);
$service = new RefundOverpaymentService(new RefundNotificationService());
$result = $service->recalculate(false, null, 1);
$this->assertNotEmpty($result['created_ids']);
@@ -27,7 +27,7 @@ class RefundPayoutServiceTest extends TestCase
'updated_at' => now(),
]);
$service = new RefundPayoutService;
$service = new RefundPayoutService();
$result = $service->recordPayment(1, [
'paid_amount' => 40,
'payment_method' => 'Cash',
@@ -2,10 +2,10 @@
namespace Tests\Unit\Services\Refunds;
use App\Services\Discounts\DiscountInvoiceService;
use App\Services\Fees\FeeRefundDetailService;
use App\Services\Refunds\RefundInvoiceAdjustmentService;
use App\Services\Refunds\RefundPolicyService;
use App\Services\Fees\FeeRefundDetailService;
use App\Services\Discounts\DiscountInvoiceService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
@@ -84,8 +84,8 @@ class RefundPolicyServiceTest extends TestCase
]);
$service = new RefundPolicyService(
new FeeRefundDetailService,
new RefundInvoiceAdjustmentService(new DiscountInvoiceService)
new FeeRefundDetailService(),
new RefundInvoiceAdjustmentService(new DiscountInvoiceService())
);
$result = $service->processWithdrawalRefund(10, 1, '2025-2026', 'Fall', 1);
@@ -40,7 +40,7 @@ class RefundQueryServiceTest extends TestCase
],
]);
$service = new RefundQueryService;
$service = new RefundQueryService();
$result = $service->list(['status' => 'Approved', 'per_page' => 10, 'page' => 1]);
$this->assertSame(1, $result['pagination']['total']);
@@ -2,13 +2,13 @@
namespace Tests\Unit\Services\Refunds;
use App\Services\Discounts\DiscountInvoiceService;
use App\Services\Fees\FeeRefundDetailService;
use App\Services\Refunds\RefundInvoiceAdjustmentService;
use App\Services\Refunds\RefundNotificationService;
use App\Services\Refunds\RefundPolicyService;
use App\Services\Refunds\RefundRequestService;
use App\Services\Refunds\RefundSummaryService;
use App\Services\Discounts\DiscountInvoiceService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
@@ -60,11 +60,11 @@ class RefundRequestServiceTest extends TestCase
$service = new RefundRequestService(
new RefundPolicyService(
new FeeRefundDetailService,
new RefundInvoiceAdjustmentService(new DiscountInvoiceService)
new FeeRefundDetailService(),
new RefundInvoiceAdjustmentService(new DiscountInvoiceService())
),
new RefundSummaryService,
new RefundNotificationService
new RefundSummaryService(),
new RefundNotificationService()
);
$result = $service->requestRefund([
@@ -53,7 +53,7 @@ class RefundSummaryServiceTest extends TestCase
'updated_at' => now(),
]);
$service = new RefundSummaryService;
$service = new RefundSummaryService();
$summary = $service->getParentFinancialSummary(10, '2025-2026', 'Fall');
$this->assertSame(100.0, $summary['total_invoiced']);