Commit b094c8f7 authored by Florian Kaiser's avatar Florian Kaiser
Browse files

initial version

parents
default_charset = "UTF-8"
always_populate_raw_post_data = -1
\ No newline at end of file
<?php
/**
* ownCloud - storageusage
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Florian Kaiser <florian.kaiser@mpcdf.mpg.de>
* @copyright Florian Kaiser 2015
*/
namespace OCA\StorageUsage\Controller;
use PHPUnit_Framework_TestCase;
use OCP\AppFramework\Http\TemplateResponse;
class PageControllerTest extends PHPUnit_Framework_TestCase {
private $controller;
private $userId = 'john';
public function setUp() {
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->controller = new PageController(
'storageusage', $request, $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());
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment