summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-06-14 04:05:38 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2019-06-14 04:15:20 +0200
commite06affae179dfeb41f77d8ad2ea81fa3f2fa439d (patch)
tree010d2501d5d2267fa8b24277295de623e3e76aba /src
parent9232513831501e8a0cb4f14299cd8f85afe7bc7f (diff)
Added tests to HomeController
Diffstat (limited to 'src')
-rw-r--r--src/Controllers/HomeController.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/Controllers/HomeController.php b/src/Controllers/HomeController.php
index 809593ce..e3989f81 100644
--- a/src/Controllers/HomeController.php
+++ b/src/Controllers/HomeController.php
@@ -2,15 +2,37 @@
namespace Engelsystem\Controllers;
+use Engelsystem\Config\Config;
+use Engelsystem\Helpers\Authenticator;
use Engelsystem\Http\Exceptions\HttpTemporaryRedirect;
class HomeController extends BaseController
{
/**
+ * @var Authenticator
+ */
+ protected $auth;
+
+ /**
+ * @var Config
+ */
+ protected $config;
+
+ /**
+ * @param Authenticator $auth
+ * @param Config $config
+ */
+ public function __construct(Authenticator $auth, Config $config)
+ {
+ $this->auth = $auth;
+ $this->config = $config;
+ }
+
+ /**
* @throws HttpTemporaryRedirect
*/
public function index()
{
- throw new HttpTemporaryRedirect(auth()->user() ? config('home_site') : 'login');
+ throw new HttpTemporaryRedirect($this->auth->user() ? $this->config->get('home_site') : 'login');
}
}