diff --git a/bootstrap.php b/bootstrap.php index 3ee3898..0191df2 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -17,6 +17,16 @@ exit(1); } +// Ensure that the `Page` and `PageController` classes exist, if they don't _(for example when testing a +// silverstripe module)_ ensure that the symbols are registered. +if (!class_exists(\Page::class)) { + require __DIR__ . '/stubs/Page.php'; +} + +if (!class_exists(\PageController::class)) { + require __DIR__ . '/stubs/PageController.php'; +} + // Ensure global $_SERVER exists global $_SERVER; if (!$_SERVER) { diff --git a/stubs/Page.php b/stubs/Page.php new file mode 100644 index 0000000..790c27d --- /dev/null +++ b/stubs/Page.php @@ -0,0 +1,8 @@ +