Skip to content

Menjalankan & Menguji ​

Perintah Harian ​

bash
php artisan serve        # server dev (http://localhost:8000)
npm run dev              # build asset admin (Vite)
composer dump-autoload   # setelah menambah class
./vendor/bin/pint        # format kode PSR-12 (Laravel Pint)
php artisan test         # jalankan seluruh test

Menjalankan Test Tertentu ​

bash
php artisan test --filter=LetterManagementTest
php artisan test tests/Feature/PdpComplianceAndDataProtectionTest.php

Konfigurasi Test ​

phpunit.xml memakai konfigurasi environment test. Test integrasi membutuhkan MySQL 8 (bukan SQLite) karena menguji query spesifik MySQL.

bash
# contoh environment test
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=sidesa_test
DB_USERNAME=root
DB_PASSWORD=password

CI GitHub Actions menjalankan migrasi + seeder otomatis sebelum test.

Peta Test ​

Kelompok TestFileCakupan
RBAC & AuthAuthAndRbacTest, UserAndRoleManagementTestLogin, guard, permission matrix
KependudukanPopulationManagementTestCRUD KK/penduduk, validasi NIK 16 digit
E-SuratLetterManagementTestTemplate, alur approval, PDF
WargaCitizenRegistrationAndAccountTestRegistrasi & consent UU PDP
CMSContentEngineIntegrationTest, MenuManagementTest, SiteSettingManagementTestArtikel, menu, settings
APBDes & GISBudgetAndGisIntegrationTest, BudgetPermendagriComplianceTest, VillageAssetGisPermendagriComplianceTestKepatuhan Permendagri
PPIDPpidKipComplianceTestUU 14/2008 & Perki 1/2018
PrivasiPdpComplianceAndDataProtectionTestMasking, scoped access RT, audit trail
TTECertifiedDigitalSignatureTteComplianceTestAlur TTE/BSrE
InstallerInstallerWorkflowTestWizard instalasi
LainnyaAuditEngineIntegrationTest, WilayahApiIntegrationTest, CustomErrorPagesTest, AdminSidebarBadgeCountTest, AppVersionHelperTest—

CI (GitHub Actions) ​

Workflow: .github/workflows/ci.yml — berjalan pada push/pull_request ke branch develop.

  • Matriks PHP: 8.1, 8.2, 8.3, 8.4, 8.5
  • Service: MySQL 8.0 (health check otomatis)
  • Langkah: composer install → npm build → key:generate → migrate --seed → php artisan test

Checklist sebelum PR

Jalankan lokal: ./vendor/bin/pint lalu php artisan test. Pastikan hijau di seluruh matriks PHP.

Dokumentasi resmi proyek SiDesa