Update tests: phpunit version, adhere to official app bootstraping
approach
This commit is contained in:
parent
de4b3d5b83
commit
be903f4602
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7.5",
|
||||
"christophwurst/nextcloud_testing": "^0.6.0"
|
||||
"phpunit/phpunit": "^8.0",
|
||||
"christophwurst/nextcloud_testing": "0.10.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - registration
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Pellaeon Lin <pellaeon@hs.ntnu.edu.tw>
|
||||
* @copyright Pellaeon Lin 2014
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../../../tests/bootstrap.php';
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
require_once __DIR__.'/../../../tests/bootstrap.php';
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
|
|
@ -67,7 +67,7 @@ class RegistrationControllerTest extends TestCase {
|
|||
/** @var ICrypto */
|
||||
private $crypto;
|
||||
|
||||
public function setUp () {
|
||||
public function setUp (): void {
|
||||
parent::setUp();
|
||||
$this->mailService = $this->createMock(MailService::class);
|
||||
$this->l10n = $this->createMock(IL10N::class);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class RegistrationServiceTest extends TestCase {
|
|||
/** @var ICrypto */
|
||||
private $crypto;
|
||||
|
||||
public function setUp () {
|
||||
public function setUp (): void {
|
||||
parent::setUp();
|
||||
$this->mailService = $this->createMock(MailService::class);
|
||||
$this->l10n = $this->createMock(IL10N::class);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<phpunit bootstrap="bootstrap.php"
|
||||
verbose="true"
|
||||
>
|
||||
<testsuite name='Registration app tests'>
|
||||
<directory suffix='Test.php'>integration</directory>
|
||||
</testsuite>
|
||||
<!-- filters for code coverage -->
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">../</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<phpunit bootstrap="bootstrap.php"
|
||||
verbose="true"
|
||||
>
|
||||
<testsuite name='Registration app tests'>
|
||||
<directory suffix='Test.php'>unit</directory>
|
||||
</testsuite>
|
||||
<!-- filters for code coverage -->
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">../</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<phpunit bootstrap="autoloader.php" colors="true">
|
||||
<testsuites>
|
||||
<testsuite name="unit">
|
||||
<directory>./unit</directory>
|
||||
</testsuite>
|
||||
<testsuite name="integration">
|
||||
<directory>./integration</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">./</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
|
@ -7,6 +7,7 @@ set -e
|
|||
cd ${BUILD_APP_MODULE_DIR}
|
||||
|
||||
composer install --prefer-dist --no-interaction -o
|
||||
vendor/bin/phpunit -c tests/phpunit.xml
|
||||
vendor/bin/phpunit -c tests/phpunit.unit.xml
|
||||
vendor/bin/phpunit -c tests/phpunit.integration.xml
|
||||
|
||||
echo "travis_fold:end:phpunit"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use OCP\Defaults;
|
|||
use OCP\IL10N;
|
||||
use OCP\IRequest;
|
||||
use OCP\IUser;
|
||||
use \Test\TestCase;
|
||||
use ChristophWurst\Nextcloud\Testing\TestCase;
|
||||
|
||||
class ApiControllerTest extends TestCase {
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ class ApiControllerTest extends TestCase {
|
|||
/** @var ApiController */
|
||||
private $controller;
|
||||
|
||||
public function setUp () {
|
||||
public function setUp (): void {
|
||||
parent::setUp();
|
||||
$this->request = $this->createMock(IRequest::class);
|
||||
$this->registrationService = $this->createMock(RegistrationService::class);
|
||||
|
|
|
|||
Loading…
Reference in New Issue