From 0996ca469285ddb226851c21b682f6f56272ce48 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 2 Oct 2021 20:49:17 +0200 Subject: [PATCH] test fixes and added more tests --- Admin/Install/Media.php | 2 +- Admin/Media.php | 50 -------------------------------- Controller/BackendController.php | 4 +-- 3 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 Admin/Media.php diff --git a/Admin/Install/Media.php b/Admin/Install/Media.php index 5acb55b..45c070b 100644 --- a/Admin/Install/Media.php +++ b/Admin/Install/Media.php @@ -45,6 +45,6 @@ class Media $defaultProfileImage = \reset($media['upload'][0]); $setting = new Setting(); - SettingMapper::create($setting->with(0, 'default_profile_image', (string) $defaultProfileImage->getId(), '\\d+', 'Profile')); + SettingMapper::create($setting->with(0, 'default_profile_image', (string) $defaultProfileImage->getId(), '\\d+', null, 'Profile')); } } diff --git a/Admin/Media.php b/Admin/Media.php deleted file mode 100644 index 5acb55b..0000000 --- a/Admin/Media.php +++ /dev/null @@ -1,50 +0,0 @@ - __DIR__ . '/Media.install.json']); - - $defaultProfileImage = \reset($media['upload'][0]); - - $setting = new Setting(); - SettingMapper::create($setting->with(0, 'default_profile_image', (string) $defaultProfileImage->getId(), '\\d+', 'Profile')); - } -} diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 8450ece..5401464 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -78,7 +78,7 @@ final class BackendController extends Controller } $profileImage = $this->app->appSettings->get(null, 'default_profile_image', null, 'Profile'); - $image = MediaMapper::get((int) $profileImage['content']); + $image = MediaMapper::get((int) $profileImage->content); $view->setData('defaultImage', $image); @@ -128,7 +128,7 @@ final class BackendController extends Controller $view->setData('media', $media instanceof NullMedia ? [] : (!\is_array($media) ? [$media] : $media)); $profileImage = $this->app->appSettings->get(null, 'default_profile_image', null, 'Profile'); - $image = MediaMapper::get((int) $profileImage['content']); + $image = MediaMapper::get((int) $profileImage->content); $view->setData('defaultImage', $image);