Add copyright statements

This commit is contained in:
Julius Haertl
2016-08-16 13:53:50 +02:00
parent 3055eaa4ac
commit f58e544733
66 changed files with 1398 additions and 81 deletions

View File

@@ -1,47 +1,56 @@
<?php
/**
* ownCloud - deck
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
* @copyright Copyright (c) 2016 Julius Härtl <jus@bitgrid.net>
*
* @author Julius Härtl <jus@bitgrid.net>
* @copyright Julius Härtl 2016
*
* @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/>.
*
*/
namespace OCA\Deck\Controller;
use PHPUnit_Framework_TestCase;
use OCP\AppFramework\Http\TemplateResponse;
class PageControllerTest extends PHPUnit_Framework_TestCase {
class PageControllerTest extends \PHPUnit_Framework_TestCase {
private $controller;
private $request;
private $l10n;
private $userId = 'john';
public function setUp() {
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->l10n = $this->request = $this->getMockBuilder(
'\OCP\IL10n')
->disableOriginalConstructor()
->getMock();
$this->request = $this->getMockBuilder(
'\OCP\IRequest')
->disableOriginalConstructor()
->getMock();
$this->controller = new PageController(
'deck', $request, $this->userId
'deck', $this->request, $this->l10n, $this->userId
);
}
public function testIndex() {
$result = $this->controller->index();
$this->assertEquals(['user' => 'john'], $result->getParams());
$this->assertEquals('main', $result->getTemplateName());
$this->assertTrue($result instanceof TemplateResponse);
}
public function testEcho() {
$result = $this->controller->doEcho('hi');
$this->assertEquals(['echo' => 'hi'], $result->getData());
$response = $this->controller->index();
$this->assertEquals('main', $response->getTemplateName());
}