aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Http/PublicTemplateResponseTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AppFramework/Http/PublicTemplateResponseTest.php')
-rw-r--r--tests/lib/AppFramework/Http/PublicTemplateResponseTest.php43
1 files changed, 12 insertions, 31 deletions
diff --git a/tests/lib/AppFramework/Http/PublicTemplateResponseTest.php b/tests/lib/AppFramework/Http/PublicTemplateResponseTest.php
index cbf8f8303c3..cb7bd97f5da 100644
--- a/tests/lib/AppFramework/Http/PublicTemplateResponseTest.php
+++ b/tests/lib/AppFramework/Http/PublicTemplateResponseTest.php
@@ -1,41 +1,23 @@
<?php
/**
- * @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
- *
- * @author Julius Härtl <jus@bitgrid.net>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\AppFramework\Http;
-use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Template\PublicTemplateResponse;
+use OCP\AppFramework\Http\Template\SimpleMenuAction;
use Test\TestCase;
class PublicTemplateResponseTest extends TestCase {
- public function testSetParamsConstructor() {
+ public function testSetParamsConstructor(): void {
$template = new PublicTemplateResponse('app', 'home', ['key' => 'value']);
- $this->assertContains('core/js/public/publicpage', \OC_Util::$scripts);
$this->assertEquals(['key' => 'value'], $template->getParams());
}
- public function testAdditionalElements() {
+ public function testAdditionalElements(): void {
$template = new PublicTemplateResponse('app', 'home', ['key' => 'value']);
$template->setHeaderTitle('Header');
$template->setHeaderDetails('Details');
@@ -44,9 +26,9 @@ class PublicTemplateResponseTest extends TestCase {
$this->assertEquals('Details', $template->getHeaderDetails());
}
- public function testActionSingle() {
+ public function testActionSingle(): void {
$actions = [
- new Http\Template\SimpleMenuAction('link', 'Download', 'download', 'downloadLink', 0)
+ new SimpleMenuAction('link', 'Download', 'download', 'downloadLink', 0)
];
$template = new PublicTemplateResponse('app', 'home', ['key' => 'value']);
$template->setHeaderActions($actions);
@@ -57,11 +39,11 @@ class PublicTemplateResponseTest extends TestCase {
}
- public function testActionMultiple() {
+ public function testActionMultiple(): void {
$actions = [
- new Http\Template\SimpleMenuAction('link1', 'Download1', 'download1', 'downloadLink1', 100),
- new Http\Template\SimpleMenuAction('link2', 'Download2', 'download2', 'downloadLink2', 20),
- new Http\Template\SimpleMenuAction('link3', 'Download3', 'download3', 'downloadLink3', 0)
+ new SimpleMenuAction('link1', 'Download1', 'download1', 'downloadLink1', 100),
+ new SimpleMenuAction('link2', 'Download2', 'download2', 'downloadLink2', 20),
+ new SimpleMenuAction('link3', 'Download3', 'download3', 'downloadLink3', 0)
];
$template = new PublicTemplateResponse('app', 'home', ['key' => 'value']);
$template->setHeaderActions($actions);
@@ -72,9 +54,8 @@ class PublicTemplateResponseTest extends TestCase {
}
- public function testGetRenderAs() {
+ public function testGetRenderAs(): void {
$template = new PublicTemplateResponse('app', 'home', ['key' => 'value']);
- $this->assertContains('core/js/public/publicpage', \OC_Util::$scripts);
$this->assertEquals(['key' => 'value'], $template->getParams());
$this->assertEquals('public', $template->getRenderAs());
}