misaf/vendra-testing

Shared testing utilities for Vendra modules

Maintainers

Package info

github.com/misaf/vendra-testing

Type:vendra-module

pkg:composer/misaf/vendra-testing

Transparency log

Statistics

Installs: 19

Dependents: 36

Suggesters: 0

Stars: 1

Open Issues: 0

v1.7.1 2026-07-22 21:54 UTC

This package is auto-updated.

Last update: 2026-07-30 13:52:12 UTC


README

Shared Pest utilities for Vendra package test suites.

Features

  • toHaveAtLeastTwoLocales() expectation
  • toHaveTranslationsInSync() expectation
  • toHaveSortedTranslationKeys() expectation
  • toSortByEverySortableColumn() Livewire table expectation
  • Deterministic translation file and key parity checks
  • Provider-neutral tenant helpers that no-op when tenancy is disabled
  • User factory helpers resolved from the configured authentication provider
  • Tenant-feature and Filament admin test-context helpers

Requirements

  • PHP 8.3+
  • Laravel 13
  • Pest 4
  • misaf/vendra-support

Installation

composer require --dev misaf/vendra-testing

Composer loads the custom expectations automatically. Use a package language directory as the expectation value:

expect(__DIR__ . '/../../resources/lang')
    ->toHaveTranslationsInSync('vendra-example')
    ->toHaveSortedTranslationKeys('vendra-example');

Tenant-aware package tests should use makeCurrentTestTenant(), switchToTestTenant(), and the related helpers instead of importing the concrete Vendra Tenant provider.

Use makeCurrentTestTenantWithFeatures() when a test needs deterministic Pennant state, and setUpFilamentAdminTestContext() to boot a package's resources in the shared admin-panel test context.

To exercise every sortable table column in both directions:

expect($listPage)->toSortByEverySortableColumn($recordsInAscendingOrder);

Testing

Run the package checks from the package directory:

composer test
composer analyse

License

MIT. See LICENSE.