diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-02-03 14:30:10 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-02-03 14:30:10 +0300 |
commit | 29c60c386966bdebc189ebaca7c7884af867e60f (patch) | |
tree | d1aeeedebc7cf1df504f0f99263f2c1cf4c653ad /tests/unit/Controller/SAMLControllerTest.php | |
parent | c96b0c15a9bd46c82ffb5ba5fe45497735a18098 (diff) |
Add better error handling
1. Enable `debug` mode if debug mode is enabled in config.php
2. Log errors to the log file
Also I fixed the unit tests that broke with https://github.com/nextcloud/user_saml/pull/81
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'tests/unit/Controller/SAMLControllerTest.php')
-rw-r--r-- | tests/unit/Controller/SAMLControllerTest.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/unit/Controller/SAMLControllerTest.php b/tests/unit/Controller/SAMLControllerTest.php index 6007f646..8bf9a2f9 100644 --- a/tests/unit/Controller/SAMLControllerTest.php +++ b/tests/unit/Controller/SAMLControllerTest.php @@ -27,10 +27,10 @@ use OCA\User_SAML\UserBackend; use OCP\AppFramework\Http\RedirectResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; +use OCP\ILogger; use OCP\IRequest; use OCP\ISession; use OCP\IURLGenerator; -use OCP\IUserBackend; use OCP\IUserManager; use OCP\IUserSession; use Test\TestCase; @@ -52,6 +52,8 @@ class SAMLControllerTest extends TestCase { private $urlGenerator; /** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */ private $userManager; + /** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */ + private $logger; /** @var SAMLController */ private $samlController; @@ -66,6 +68,7 @@ class SAMLControllerTest extends TestCase { $this->config = $this->createMock(IConfig::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->userManager = $this->createMock(IUserManager::class); + $this->logger = $this->createMock(ILogger::class); $this->samlController = new SAMLController( 'user_saml', @@ -76,7 +79,8 @@ class SAMLControllerTest extends TestCase { $this->userBackend, $this->config, $this->urlGenerator, - $this->userManager + $this->userManager, + $this->logger ); } |