Remove IE8 support in CertificateController

* Also fix getMock warnings in tests
This commit is contained in:
Roeland Jago Douma 2016-08-16 20:51:43 +02:00
parent 0cb8f74cd1
commit fd95985a21
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
2 changed files with 6 additions and 10 deletions

View File

@ -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);

View File

@ -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')