File tree Expand file tree Collapse file tree 3 files changed +22
-5
lines changed
tests/webfiori/framework/test Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 88use webfiori \framework \App ;
99use webfiori \framework \Lang ;
1010use webfiori \framework \session \SessionsManager ;
11- use webfiori \framework \Theme ;
11+ use webfiori \framework \ThemeManager ;
1212use webfiori \framework \ui \WebPage ;
1313use webfiori \framework \User ;
1414use WebFiori \UI \HTMLNode ;
1818 * @author Ibrahim
1919 */
2020class PageTest extends TestCase {
21+
22+ protected function setUp (): void {
23+ parent ::setUp ();
24+
25+ // Register test themes to avoid directory creation errors
26+ $ registeredThemes = ThemeManager::getRegisteredThemes ();
27+ $ themeNames = array_keys ($ registeredThemes );
28+
29+ if (!in_array ('New Theme 2 ' , $ themeNames )) {
30+ ThemeManager::register (new \themes \fioriTheme2 \NewTestTheme2 ());
31+ }
32+
33+ if (!in_array ('New Super Theme ' , $ themeNames )) {
34+ ThemeManager::register (new \themes \fioriTheme \NewFTestTheme ());
35+ }
36+ }
37+
2138 /**
2239 * @test
2340 */
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ public function testAddDBConnection01() {
8383 '127.0.0.1 ' ,
8484 "\n" , // Hit Enter to pick default value (port 3306)
8585 'root ' ,
86- getenv ( ' MYSQL_ROOT_PASSWORD ' ) ?: ' 12345326 ' ,
86+ ' not_correct ' ,
8787 'testing_db ' ,
8888 "\n" , // Hit Enter to pick default value (connection name)
8989 'y '
@@ -129,7 +129,7 @@ public function testAddDBConnection02() {
129129 '127.0.0.1 ' ,
130130 "\n" , // Hit Enter to pick default value (port 3306)
131131 'root ' ,
132- getenv ( ' MYSQL_ROOT_PASSWORD ' ) ?: ' 12345326 ' ,
132+ ' not_correct ' ,
133133 'testing_db ' ,
134134 "\n" , // Hit Enter to pick default value (connection name)
135135 'n '
Original file line number Diff line number Diff line change @@ -144,10 +144,10 @@ private static function registerResourcesRoutes(Theme $theme) {
144144 $ assetsFolderName = 'assets ' ;
145145 $ publicPath = ROOT_PATH .DS .PUBLIC_FOLDER .DS .$ assetsFolderName .DS ;
146146 $ themeResourcesPath = $ theme ->getAbsolutePath ().DS .$ assetsFolderName .DS ;
147- $ themePublicPath = $ publicPath .DS .$ theme ->getDirectoryName ();
147+ $ themePublicPath = $ publicPath .DS .$ assetsFolderName . DS . $ theme ->getDirectoryName (). DS . $ theme -> getVersion (). DS ;
148148
149149 if (!is_dir ($ themePublicPath )) {
150- mkdir ($ themePublicPath , 0777 );
150+ mkdir ($ themePublicPath , 0777 , true );
151151 $ jsDir = $ themeResourcesPath .$ theme ->getJsDirName ();
152152 if (is_dir ($ jsDir )) {
153153 mkdir ($ themePublicPath .DS .$ theme ->getJsDirName ());
You can’t perform that action at this time.
0 commit comments