55use framework \Model ;
66use framework \View ;
77
8- // Define minimal configuration constants required by the framework.
9- $ rootPath = realpath (__DIR__ . '/.. ' );
10- $ projectRoot = dirname ($ rootPath );
11-
12- if (!defined ('RELATIVE_PATH ' )) {
13- define ('RELATIVE_PATH ' , $ projectRoot . DIRECTORY_SEPARATOR );
14- }
15- if (!defined ('SECURING_OUTSIDE_HTTP_FOLDER ' )) {
16- define ('SECURING_OUTSIDE_HTTP_FOLDER ' , '' );
17- }
18- if (!defined ('APP_CONTROLLERS_PATH ' )) {
19- define ('APP_CONTROLLERS_PATH ' , $ projectRoot . DIRECTORY_SEPARATOR . 'controllers ' );
20- }
21- if (!defined ('APP_LOCALE_PATH ' )) {
22- define ('APP_LOCALE_PATH ' , $ projectRoot . DIRECTORY_SEPARATOR . 'locales ' );
23- }
24- if (!defined ('JSFRAMEWORK ' )) {
25- define ('JSFRAMEWORK ' , 'framework/js ' );
26- }
27- if (!defined ('SITEURL ' )) {
28- define ('SITEURL ' , 'http://localhost ' );
29- }
30- if (!defined ('SERVER_OS_ENCODING ' )) {
31- define ('SERVER_OS_ENCODING ' , 'Linux ' );
32- }
33- if (!defined ('DEFAULT_LOGIN_PAGE ' )) {
34- define ('DEFAULT_LOGIN_PAGE ' , 'common/login ' );
35- }
36- if (!defined ('LoginRBACWarningMessage ' )) {
37- define ('LoginRBACWarningMessage ' , 'login-rbac-warning ' );
38- }
39- if (!defined ('LoginAuthWarningMessage ' )) {
40- define ('LoginAuthWarningMessage ' , 'login-auth-warning ' );
41- }
42- if (!defined ('COMPRESS_OUTPUT ' )) {
43- define ('COMPRESS_OUTPUT ' , false );
44- }
45- if (!defined ('CHARSET ' )) {
46- define ('CHARSET ' , 'UTF-8 ' );
47- }
48- if (!defined ('SUBSYSTEMS ' )) {
49- define ('SUBSYSTEMS ' , serialize (['sub ' ]));
50- }
51-
52- require_once $ projectRoot . '/framework/Loader.php ' ;
53- require_once $ projectRoot . '/framework/Model.php ' ;
54- require_once $ projectRoot . '/framework/View.php ' ;
55- require_once $ projectRoot . '/framework/Controller.php ' ;
8+ require_once __DIR__ . '/TestHelper.php ' ;
9+ require_once RELATIVE_PATH . 'framework/Loader.php ' ;
10+ require_once RELATIVE_PATH . 'framework/Model.php ' ;
11+ require_once RELATIVE_PATH . 'framework/View.php ' ;
12+ require_once RELATIVE_PATH . 'framework/Controller.php ' ;
5613
5714class FakeModel extends Model
5815{
@@ -197,17 +154,4 @@ public function testGetSubSystemDetectsCurrentSubsystem(): void
197154
198155 $ this ->assertSame ('sub ' , $ controller ->getSubSystem ());
199156 }
200-
201- public function testSetAsChildControllerSwitchesRootFlag (): void
202- {
203- $ controller = new TestableController (new FakeView ('<div>test</div> ' ), new FakeModel ());
204-
205- $ this ->assertTrue ($ controller ->isRootController ());
206- $ this ->assertFalse ($ controller ->isChildController ());
207-
208- $ controller ->setAsChildController ();
209-
210- $ this ->assertFalse ($ controller ->isRootController ());
211- $ this ->assertTrue ($ controller ->isChildController ());
212- }
213- }
157+ }
0 commit comments