. namespace core\tests; /** * Test helper for the \core\environment class. * * @package core * @copyright Andrew Lyons * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class environment extends \core\environment { /** @var string|null The path to the vendor dir if modified */ protected static ?string $vendorpath; /** @var bool|null Whether developer mode is enabled, or defer to $CFG */ protected static ?bool $devmode = null; /** * Set the developer mode for testing purposes. * * @param bool $enabled */ public static function set_developer_mode(bool $enabled): void { self::$devmode = $enabled; } /** * Set the vendor path for testing purposes. * * @param string $path */ public static function set_vendor_path(string $path): void { self::$vendorpath = $path; } #[\Override] protected static function get_vendor_path(): string { if (self::$vendorpath) { return self::$vendorpath; } return parent::get_vendor_path(); } #[\Override] protected static function is_developer_mode_enabled(): bool { if (self::$devmode !== null) { return self::$devmode; } return parent::is_developer_mode_enabled(); } }