add controllers, servoices

This commit is contained in:
root
2026-03-09 02:52:13 -04:00
parent c8de5f7edc
commit d76c871cb7
501 changed files with 34439 additions and 21843 deletions
@@ -0,0 +1,61 @@
<?php
namespace Tests\Unit\Services\Payments;
use App\Services\Discounts\DiscountInvoiceService;
use App\Services\Payments\PaymentEnrollmentEventService;
use App\Services\Payments\PaymentManualService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Mockery;
use Tests\TestCase;
class PaymentManualServiceTest extends TestCase
{
use RefreshDatabase;
public function test_record_payment_rejects_invalid_method(): void
{
$invoiceService = Mockery::mock(DiscountInvoiceService::class);
$enrollmentService = Mockery::mock(PaymentEnrollmentEventService::class);
$service = new PaymentManualService($invoiceService, $enrollmentService);
$this->expectException(\InvalidArgumentException::class);
$service->recordPayment(1, 10.0, 'wire', null, null, null, null);
}
public function test_suggest_returns_matches(): void
{
DB::table('users')->insert([
'id' => 10,
'school_id' => 1,
'firstname' => 'Parent',
'lastname' => 'User',
'cellphone' => '555-555-5555',
'email' => 'parent@example.com',
'address_street' => '123 Main',
'city' => 'City',
'state' => 'ST',
'zip' => '12345',
'accept_school_policy' => 1,
'is_verified' => 1,
'status' => 'Active',
'is_suspended' => 0,
'failed_attempts' => 0,
'password' => bcrypt('secret'),
'semester' => 'Fall',
'school_year' => '2025-2026',
]);
$invoiceService = Mockery::mock(DiscountInvoiceService::class);
$enrollmentService = Mockery::mock(PaymentEnrollmentEventService::class);
$service = new PaymentManualService($invoiceService, $enrollmentService);
$results = $service->suggest('parent@example.com');
$this->assertCount(1, $results);
$this->assertSame('parent@example.com', $results[0]['value']);
}
}