NativePHP
Windows support is here! 🔥 Read the full announcement →
Power Monitor

NativePHP is currently in alpha development

Let's get to beta!

#
Fake Power Monitor

#
Example test case

Copied!
1use Native\Laravel\Facades\PowerMonitor;
2 
3#[\PHPUnit\Framework\Attributes\Test]
4public function example(): void
5{
6 PowerMonitor::fake();
7 
8 $this->get('/whatever-action');
9 
10 PowerMonitor::assertGetSystemIdleState('...');
11}

#
Available assertions

  • assertGetSystemIdleState
  • assertGetSystemIdleStateCount
  • assertGetSystemIdleTimeCount
  • assertGetCurrentThermalStateCount
  • assertIsOnBatteryPowerCount