icecave/isolator
Icecave Isolator isolates and mocks PHP global state for testing. It provides PHPUnit integration to snapshot and restore global variables, superglobals, constants, and functions, so each test runs in a clean, predictable environment free of hidden state leakage and side effects.
Isolator is a PHP library for isolating static methods and global functions during unit tests, making otherwise untestable code—especially legacy code—fully mockable. It works by loading classes through a custom class loader that rewrites source code at runtime, redirecting calls to functions like time() or rand() toward controllable test doubles.
time(), rand(), and file_get_contents()How can I help you explore Laravel packages today?