Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Feb 13, 2019
1 parent a6722de commit fa0315a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 44 deletions.
4 changes: 1 addition & 3 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
class PageController extends Controller {

protected $appName;
private $userId;

/**
* @var IConfig
Expand All @@ -40,11 +39,10 @@ class PageController extends Controller {

public function __construct(string $AppName,
IRequest $request,
string $UserId = null,
IConfig $config) {
parent::__construct($AppName, $request);

$this->appName = $AppName;
$this->userId = $UserId;
$this->config = $config;
}

Expand Down
36 changes: 0 additions & 36 deletions tests/integration/AppTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/unit/ContactsMenu/Provider/DetailsProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DetailsProviderTest extends Base {
/** @var DetailsProvider */
private $provider;

protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->urlGenerator = $this->createMock(IURLGenerator::class);
Expand Down
9 changes: 5 additions & 4 deletions tests/unit/Controller/PageControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@
class PageControllerTest extends Base {

private $controller;
private $userId = 'john';

public function setUp() {
public function setUp(): void {
$config = $this->getMockBuilder('OCP\IConfig')->getMock();
$request = $this->getMockBuilder('OCP\IRequest')->getMock();

$this->controller = new PageController(
'contacts', $request, $this->userId
'contacts',
$request,
$config
);
}


public function testIndex() {
$result = $this->controller->index();

$this->assertEquals(['user' => 'john'], $result->getParams());
$this->assertEquals('main', $result->getTemplateName());
$this->assertEquals('user', $result->getRenderAs());
$this->assertTrue($result instanceof TemplateResponse);
Expand Down

0 comments on commit fa0315a

Please sign in to comment.