Freshly Baked • Deliciously Served • Always with Love

Sign In to Eniceberny

Order faster & track deliveries

Sign In →
Eniceberny Bakery and Catering Enterprise

Automated Testing & Quality Assurance Guide

This document details the test suites, execution procedures, assertion metrics, and CI/CD pipelines governing the Eniceberny Bakery and Culinary Hub platform.


1. Test Architecture & Standards

Quality assurance is enforced through comprehensive automated testing using PHPUnit and Laravel's HTTP test utilities:

  • Isolated In-Memory Database: All test suites execute against high-speed in-memory SQLite instances (:memory:), guaranteeing complete test isolation without residual side-effects.
  • Automated Seeding Integration: Test classes leverage the RefreshDatabase trait with protected bool $seed = true;, ensuring authentic catalog categories, menu delicacies, and role permissions are present during every test run.
  • Zero-Mock Financial Verification: Payment callbacks, cart additions, discount deductions, and order conversions are executed against real Eloquent database models.

2. Comprehensive Test Suite Inventory (130 Tests, 607 Assertions, 12 Test Classes)

The platform test suite contains 130 automated tests across twelve specialized feature test classes:

Test Suite Class File Path Key Focus Areas
DeveloperPanelAndRbacTest tests/Feature/DeveloperPanelAndRbacTest.php Developer admin panel isolation, zero-financial access policy, session preservation on cache flush, queue retries, maintenance commands, Super Admin governance.
PlatformFeatureAuditTest tests/Feature/PlatformFeatureAuditTest.php Full in-app feature verification runner (platform:test-all), markdown report validation, external test runner script integrity.
AccountSettingsAndReportsTest tests/Feature/AccountSettingsAndReportsTest.php Customer preferences, culinary notes, dietary restrictions, admin report analytics, CSV stream exports.
AdminTest tests/Feature/AdminTest.php Access control, live dashboard metrics, order status updates, POS transactions, modular settings, brand logo uploads, security file rejections.
BarcodeScannerAndPosTest tests/Feature/BarcodeScannerAndPosTest.php Hardware USB barcode wedge processing, camera scanner component architecture, live barcode lookup API (/admin/pos/lookup-barcode).
CmsAndBroadcastTest tests/Feature/CmsAndBroadcastTest.php Marketing copy updates, testimonials CRUD, CMS pages, email broadcast center, customer permission boundaries.
ExampleTest tests/Feature/ExampleTest.php Basic HTTP 200 health verification.
Phase25ErpAndGhanaComplianceTest tests/Feature/Phase25ErpAndGhanaComplianceTest.php Ghana Act 843 compliance, terms of service, granular staff permissions, public invoice lookups, catering conversion to orders, takeaway/dine-in POS modes.
Phase2CommerceTest tests/Feature/Phase2CommerceTest.php Customer account profiles, delivery address management, order history, Paystack webhooks, POS sales, coupon code validation, sliding cart drawer data.
Phase3OperationsAndCmsTest tests/Feature/Phase3OperationsAndCmsTest.php Admin navigation architecture, product variants and options, homepage sections, catering services/quotes, customer addresses ledger, audit log redaction, sitemaps.
ResilientPaymentAndFulfillmentTest tests/Feature/ResilientPaymentAndFulfillmentTest.php Multi-gateway failover (Paystack, MTN MoMo, Moolre, Cash), Render /up health probe, cron schedule execution, queue worker recovery, dine-in vs takeaway fulfillment, manual payment confirmation.
StorefrontTest tests/Feature/StorefrontTest.php Cinematic landing page sections, shop catalog filters, end-to-end checkout flow, reverse geocoding API, bag drawer integration, printable receipts, OTP verification.

3. Automated E2E Feature Test Scripts & In-App Audit Runner

To guarantee that 100% of platform subsystems function correctly before deployments or major PR merges, the repository provides unified test runners that inspect all 12 operational subsystems:

3.1 In-App Feature Audit Artisan Command

# Run comprehensive audit with markdown report generation
php artisan platform:test-all --report

# Fast audit (skips slower external network latency tests)
php artisan platform:test-all --quick

12 Audited Modules:

  1. System Environment & Runtime Health: PHP 8.2+, database latency & tables, cache roundtrip, queue readiness, storage writeability.
  2. Public Storefront & Visual CMS: Routes, active catalog, contact headquarters GPS & directions, /up probe.
  3. Interactive Doorstep Geocoding Engine: Kumasi reverse geocode resolution, GhanaPost GPS synthesis.
  4. Shopping Bag & Cart Engine: Adding items, line totals, updating quantities, clearing drawer.
  5. Customer Authentication & Address Book: Super Admin status, test user creation, address book with GPS coordinates.
  6. Multi-Fulfillment Checkout Engine: Doorstep delivery, store pickup, dine-in table fulfillment, order numbers (ECH-...).
  7. Multi-Gateway Payment System: Cash, MoMo, Paystack drivers, transaction recording.
  8. Point of Sale (POS) Counter System: POS transactions, cash tendered, change computation, hardware barcodes.
  9. Admin Backoffice & Operations: Dashboard metrics, inventory adjustments, security audit logging.
  10. Catering Inquiries & Custom Quotes: Inquiry submission, quotation generation.
  11. Background Queue & Worker Resilience: Job dispatching, queue:work --once, failed job pruning.
  12. Cron Scheduler & SEO Engine: Cron tasks validation, sitemap/robots generation, SEO pings.

3.2 Linux / macOS / Render / CI Runner (scripts/test-all-features.sh)

bash scripts/test-all-features.sh [--quick] [--skip-build]

3.3 Windows PowerShell Runner (scripts/test-all-features.ps1)

powershell -ExecutionPolicy Bypass -File .\scripts\test-all-features.ps1 [-Quick] [-SkipBuild]

4. Running Tests Locally

4.1 Run Complete Test Suite

Execute the entire test suite from the repository root:

php artisan test

Expected output:

  PASS  Tests\Feature\AccountSettingsAndReportsTest
  PASS  Tests\Feature\AdminTest
  PASS  Tests\Feature\BarcodeScannerAndPosTest
  PASS  Tests\Feature\CmsAndBroadcastTest
  PASS  Tests\Feature\DeveloperPanelAndRbacTest
  PASS  Tests\Feature\ExampleTest
  PASS  Tests\Feature\Phase25ErpAndGhanaComplianceTest
  PASS  Tests\Feature\Phase2CommerceTest
  PASS  Tests\Feature\Phase3OperationsAndCmsTest
  PASS  Tests\Feature\PlatformFeatureAuditTest
  PASS  Tests\Feature\ResilientPaymentAndFulfillmentTest
  PASS  Tests\Feature\StorefrontTest

  Tests:    130 passed (607 assertions)
  Duration: ~35s

4.2 Run Specific Test Classes or Filters

Target individual feature areas during local development:

# Run only Admin tests
php artisan test --filter AdminTest

# Run only Storefront & Checkout tests
php artisan test --filter StorefrontTest

# Run Ghana compliance and ERP tests
php artisan test --filter Phase25ErpAndGhanaComplianceTest

# Run a specific single test method
php artisan test --filter test_catering_inquiry_can_be_converted_to_official_order

4. Continuous Integration Pipeline (GitHub Actions)

Every pull request and push to the main branch automatically triggers the automated CI/CD pipeline defined in .github/workflows/ci.yml:

graph TD
    A[Push / PR to main] --> B[GitHub Actions Runner: ubuntu-latest]
    B --> C[Setup PHP 8.4 with required extensions]
    B --> D[Setup Node.js 20 with npm cache]
    C --> E[composer install --prefer-dist --optimize-autoloader]
    D --> F[npm ci && npm run build]
    E --> G[Copy .env.example & Generate Key]
    F --> G
    G --> H[php artisan test --colors=always]
    H -->|All 82 Tests Pass| I[Production Render Deployment Trigger]
    H -->|Any Failure| J[Halt & Reject Deployment]

CI Requirements:

  • PHP Version: 8.4 (matching production runtime and Symfony 8.1 dependencies).
  • PHP Extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_sqlite, pdo_pgsql, bcmath, gd, zip.
  • Node.js: 20.x compiling Tailwind v3 and Vite bundles.
  • Coverage: Fast execution without xdebug overhead (coverage: none).