Skip to content

PAM Native Testing

Every PAM Native product runs on the PAM runtime. Install and verify PAM first, create a Native application, and add this package through PAM Composer:

Terminal window
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh | sh
pam doctor
pam init my-app --template native
cd my-app
pam composer require pushinbr/pam-native-testing
pam doctor
pam native dev
$native = NativeTestHarness::install();
$native->succeed('auth.session', 'current', [
'identifier' => 'user-1',
'state' => 2,
]);
// Exercise production code.
$native->assertCalled('auth.session', 'current');
$native->assertSatisfied();
NativeTestHarness::uninstall();

NativeTestHarness owns install/teardown; FakeNativeModuleTransport stubs success/failure, records calls, defers callbacks, and asserts completion; DispatchMode, RecordedModuleCall, and StubbedModuleResponse type fixtures.

Unstubbed calls fail immediately. Always call assertSatisfied() to catch unused responses and pending completions, flush deferred work, and uninstall in teardown even after failure so production transport cannot leak between tests.