Initial Ladill Give extraction — online giving pages at give.ladill.com.
Donation checkout via Ladill Pay (9% fee), church/giving QR pages, SSO, and platform scan forwarding. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*/
|
||||
public function test_that_true_is_true(): void
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Services\Qr;
|
||||
|
||||
use App\Models\QrCode;
|
||||
use App\Models\User;
|
||||
use App\Services\Qr\QrCodeManagerService;
|
||||
use App\Services\Qr\QrImageGeneratorService;
|
||||
use App\Services\Qr\QrPayloadValidator;
|
||||
use App\Services\Qr\QrWalletBillingService;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PaymentQrUpdateTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_payment_qr_update_persists_business_fields(): void
|
||||
{
|
||||
$user = User::create([
|
||||
'public_id' => (string) Str::uuid(),
|
||||
'name' => 'Trader',
|
||||
'email' => 'trader@example.com',
|
||||
]);
|
||||
|
||||
$qrCode = QrCode::create([
|
||||
'user_id' => $user->id,
|
||||
'short_code' => 'paytest01',
|
||||
'type' => QrCode::TYPE_PAYMENT,
|
||||
'label' => 'Till 1',
|
||||
'payload' => [
|
||||
'content' => [
|
||||
'business_name' => 'Old Shop',
|
||||
'branch_label' => 'Main',
|
||||
'currency' => 'GHS',
|
||||
],
|
||||
'style' => [],
|
||||
],
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$manager = new QrCodeManagerService(
|
||||
$this->createMock(QrWalletBillingService::class),
|
||||
$this->createMock(QrImageGeneratorService::class),
|
||||
new QrPayloadValidator(),
|
||||
);
|
||||
|
||||
$updated = $manager->update($qrCode, [
|
||||
'business_name' => 'New Shop',
|
||||
'branch_label' => 'Accra Mall',
|
||||
]);
|
||||
|
||||
$this->assertSame('New Shop', $updated->content()['business_name']);
|
||||
$this->assertSame('Accra Mall', $updated->content()['branch_label']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user