From 3f22c5c267fd04971bcdbc3bf463c5990b113780 Mon Sep 17 00:00:00 2001 From: absurdo Date: Fri, 7 Jul 2023 23:33:02 +0200 Subject: [PATCH] Fixes in slugify function and router tests --- libraries/Utils.php | 2 +- modules/admin/controllers/app.php | 11 +++++++++++ tests/RouterTest.php | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libraries/Utils.php b/libraries/Utils.php index 56cf754..9357835 100644 --- a/libraries/Utils.php +++ b/libraries/Utils.php @@ -78,7 +78,7 @@ class Utils { if (empty($text)) { - return 'n-a'; + return ''; }else { diff --git a/modules/admin/controllers/app.php b/modules/admin/controllers/app.php index b78890b..3848097 100644 --- a/modules/admin/controllers/app.php +++ b/modules/admin/controllers/app.php @@ -16,6 +16,17 @@ function controller($switch='') { if(PhangoModule\Admin\login()) { + if($switch=='') { + + echo View::load_view(['title' => 'Admin', 'content' => ''], 'dashboard'); + + } + else { + + //Include module admin. + + } + } else { diff --git a/tests/RouterTest.php b/tests/RouterTest.php index eabdda7..a4656ca 100644 --- a/tests/RouterTest.php +++ b/tests/RouterTest.php @@ -23,7 +23,7 @@ class RouterTest extends TestCase { public function testGetGoodController() { - $path_info='/welcome/index/good'; + $path_info='/welcome/app/good'; $this->assertEquals('All things are good!', \PhangoApp\PhaRouter\get_route($path_info)); @@ -38,7 +38,7 @@ class RouterTest extends TestCase { $this->assertEquals([], \PhangoApp\PhaRouter\filter_path('/')); - $this->assertEquals([1 => 'nono-d'], \PhangoApp\PhaRouter\filter_path('/ñoño“ħˀð¶€')); + $this->assertEquals([1 => 'nonohdEUR'], \PhangoApp\PhaRouter\filter_path('/ñoño“ħˀð¶€')); $this->assertEquals([1 => 'nono', 2 => 'sucks'], \PhangoApp\PhaRouter\filter_path('/ñoño/sucks'));