Global Shortcut
NativePHP is currently in alpha development
Let's get to beta!#Fake Global Shortcuts
#Example test case
Copied!
1use Native\Laravel\Facades\GlobalShortcut; 2 3#[\PHPUnit\Framework\Attributes\Test] 4public function example(): void 5{ 6 GlobalShortcut::fake(); 7 8 $this->get('/whatever-action'); 9 10 GlobalShortcut::assertKey('CmdOrCtrl+,');11 GlobalShortcut::assertRegisteredCount(1);12 GlobalShortcut::assertEvent(OpenPreferencesEvent::class);13}
#Available assertions
-
assertKey
-
assertRegisteredCount
-
assertUnregisteredCount
-
assertEvent