Fixes in slugify function and router tests

This commit is contained in:
absurdo 2023-07-07 23:33:02 +02:00
parent fd88fff9d2
commit 3f22c5c267
3 changed files with 14 additions and 3 deletions

View file

@ -78,7 +78,7 @@ class Utils {
if (empty($text)) { if (empty($text)) {
return 'n-a'; return '';
}else { }else {

View file

@ -16,6 +16,17 @@ function controller($switch='') {
if(PhangoModule\Admin\login()) { if(PhangoModule\Admin\login()) {
if($switch=='') {
echo View::load_view(['title' => 'Admin', 'content' => ''], 'dashboard');
}
else {
//Include module admin.
}
} }
else { else {

View file

@ -23,7 +23,7 @@ class RouterTest extends TestCase {
public function testGetGoodController() { 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)); $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([], \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')); $this->assertEquals([1 => 'nono', 2 => 'sucks'], \PhangoApp\PhaRouter\filter_path('/ñoño/sucks'));