From fd95985a21297d6fe8e2c8234a263154923e1def Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 16 Aug 2016 20:51:43 +0200 Subject: [PATCH] Remove IE8 support in CertificateController * Also fix getMock warnings in tests --- settings/Controller/CertificateController.php | 4 ---- .../Controller/CertificateControllerTest.php | 12 ++++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/settings/Controller/CertificateController.php b/settings/Controller/CertificateController.php index 4a527036a7f..8121bec2ce1 100644 --- a/settings/Controller/CertificateController.php +++ b/settings/Controller/CertificateController.php @@ -86,10 +86,6 @@ class CertificateController extends Controller { */ private function addCertificate(ICertificateManager $certificateManager) { $headers = []; - if ($this->request->isUserAgent([\OC\AppFramework\Http\Request::USER_AGENT_IE_8])) { - // due to upload iframe workaround, need to set content-type to text/plain - $headers['Content-Type'] = 'text/plain'; - } if ($this->isCertificateImportAllowed() === false) { return new DataResponse(['message' => 'Individual certificate management disabled'], Http::STATUS_FORBIDDEN, $headers); diff --git a/tests/Settings/Controller/CertificateControllerTest.php b/tests/Settings/Controller/CertificateControllerTest.php index c9ea2a4024f..36b5715e734 100644 --- a/tests/Settings/Controller/CertificateControllerTest.php +++ b/tests/Settings/Controller/CertificateControllerTest.php @@ -51,11 +51,11 @@ class CertificateControllerTest extends \Test\TestCase { public function setUp() { parent::setUp(); - $this->request = $this->getMock('\OCP\IRequest'); - $this->certificateManager = $this->getMock('\OCP\ICertificateManager'); - $this->systemCertificateManager = $this->getMock('\OCP\ICertificateManager'); - $this->l10n = $this->getMock('\OCP\IL10N'); - $this->appManager = $this->getMock('OCP\App\IAppManager'); + $this->request = $this->getMockBuilder('\OCP\IRequest')->getMock(); + $this->certificateManager = $this->getMockBuilder('\OCP\ICertificateManager')->getMock(); + $this->systemCertificateManager = $this->getMockBuilder('\OCP\ICertificateManager')->getMock(); + $this->l10n = $this->getMockBuilder('\OCP\IL10N')->getMock(); + $this->appManager = $this->getMockBuilder('OCP\App\IAppManager')->getMock(); $this->certificateController = $this->getMockBuilder('OC\Settings\Controller\CertificateController') ->setConstructorArgs( @@ -90,7 +90,7 @@ class CertificateControllerTest extends \Test\TestCase { 'name' => 'goodCertificate.crt', ]; - $certificate = $this->getMock('\OCP\ICertificate'); + $certificate = $this->getMockBuilder('\OCP\ICertificate')->getMock(); $certificate ->expects($this->once()) ->method('getName')