PAM Native Testing
Start here
Section titled “Start here”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:
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh | shpam doctorpam init my-app --template nativecd my-apppam composer require pushinbr/pam-native-testingpam doctorpam 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.