You're viewing an older version of this documentation. View the latest version (2.x)
Global Shortcut
Fake Global Shortcuts#
Example test case#
Copied!
use Native\Laravel\Facades\GlobalShortcut; #[\PHPUnit\Framework\Attributes\Test]public function example(): void{ GlobalShortcut::fake(); $this->get('/whatever-action'); GlobalShortcut::assertKey('CmdOrCtrl+,'); GlobalShortcut::assertRegisteredCount(1); GlobalShortcut::assertEvent(OpenPreferencesEvent::class);}
Available assertions#
assertKeyassertRegisteredCountassertUnregisteredCountassertEvent
NativePHP
Bring your
Laravel
skills to
mobile apps.
NativePHP Ultra
All NativePHP plugins, teams & priority support from
$35/mo
Learn More
The Vibes
The unofficial Laracon US
Day 3
Grab Your Spot
Only 100 tickets!
The Masterclass
Go from zero to
published app
in no time
in no time
Learn More
Early Bird Pricing