Build your NativePHP apps in the cloud. Plans from $19/month + a FREE Mobile Mini license

Shell


#Fake Shell

#Example test case

Copied!
use Native\Desktop\Facades\Shell;
 
#[\PHPUnit\Framework\Attributes\Test]
public function example(): void
{
Shell::fake();
 
$this->get('/whatever-action');
 
Shell::assertOpenedExternal('https://some-url.test');
}

#Available assertions

  • assertShowInFolder
  • assertOpenedFile
  • assertTrashedFile
  • assertOpenedExternal