Skip to content
This repository was archived by the owner on May 18, 2024. It is now read-only.

Commit 29ebf04

Browse files
committed
Bootstrap Common.php during testing
1 parent 646ca06 commit 29ebf04

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/tests/_support/bootstrap.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@
3434
$_SERVER['app.baseURL'] = 'http://example.com';
3535
}
3636

37+
// Let's see if an app/Common.php file exists
38+
if (file_exists(APPPATH . 'Common.php'))
39+
{
40+
require_once APPPATH . 'Common.php';
41+
}
42+
43+
// Require system/Common.php
44+
require_once SYSTEMPATH . 'Common.php';
45+
46+
// Set environment values that would otherwise stop the framework from functioning during tests.
47+
if (! isset($_SERVER['app.baseURL']))
48+
{
49+
$_SERVER['app.baseURL'] = 'http://example.com';
50+
}
51+
3752
// Load necessary modules
3853
require_once APPPATH . 'Config/Autoload.php';
3954
require_once APPPATH . 'Config/Constants.php';

0 commit comments

Comments
 (0)