Skip to content

Commit

Permalink
make tests compatible with phpunit 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Veyssier committed Apr 1, 2019
1 parent e9f781d commit 2d1c0ab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ before_install:
- make appstore
# install core
- cd ../
- git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH nextcloud
#- git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH nextcloud
- wget -q https://download.nextcloud.com/server/releases/nextcloud-15.0.2.zip ; unzip -q nextcloud-15.0.2.zip ; rm nextcloud-15.0.2.zip
- mv maps nextcloud/apps/

before_script:
Expand Down
3 changes: 1 addition & 2 deletions tests/Integration/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class AppTest extends TestCase {

private $container;

public function setUp() {
parent::setUp();
protected function setUp(): void {
$app = new App('maps');
$this->container = $app->getContainer();
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Controller/FavoritesControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FavoriteControllerTest extends \PHPUnit\Framework\TestCase {
private $pageController2;
private $utilsController;

public static function setUpBeforeClass() {
public static function setUpBeforeClass(): void {
$app = new Application();
$c = $app->getContainer();

Expand Down Expand Up @@ -49,7 +49,7 @@ public static function setUpBeforeClass() {
$c->getServer()->getGroupManager()->get('group2test')->addUser($u2);
}

public function setUp() {
protected function setUp(): void {
$this->appName = 'maps';
$this->request = $this->getMockBuilder('\OCP\IRequest')
->disableOriginalConstructor()
Expand Down Expand Up @@ -109,7 +109,7 @@ public function setUp() {
);
}

public static function tearDownAfterClass() {
public static function tearDownAfterClass(): void {
$app = new Application();
$c = $app->getContainer();
$user = $c->getServer()->getUserManager()->get('test');
Expand All @@ -122,7 +122,7 @@ public static function tearDownAfterClass() {
$c->getServer()->getGroupManager()->get('group2test')->delete();
}

public function tearDown() {
protected function tearDown(): void {
// in case there was a failure and something was not deleted
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Controller/PageControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PageControllerTest extends \PHPUnit\Framework\TestCase {
private $controller;
private $userId = 'john';

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

$this->controller = new PageController(
Expand Down

0 comments on commit 2d1c0ab

Please sign in to comment.