diff --git a/composer.json b/composer.json index e4a4f57..c1b7598 100644 --- a/composer.json +++ b/composer.json @@ -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" } } diff --git a/tests/autoloader.php b/tests/autoloader.php deleted file mode 100644 index ffaf089..0000000 --- a/tests/autoloader.php +++ /dev/null @@ -1,12 +0,0 @@ - - * @copyright Pellaeon Lin 2014 - */ - -require_once __DIR__ . '/../../../tests/bootstrap.php'; diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..6c3a57e --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,4 @@ +mailService = $this->createMock(MailService::class); $this->l10n = $this->createMock(IL10N::class); diff --git a/tests/integration/service/RegistrationServiceTest.php b/tests/integration/service/RegistrationServiceTest.php index 59f04ba..ff55785 100644 --- a/tests/integration/service/RegistrationServiceTest.php +++ b/tests/integration/service/RegistrationServiceTest.php @@ -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); diff --git a/tests/phpunit.integration.xml b/tests/phpunit.integration.xml new file mode 100644 index 0000000..941d68e --- /dev/null +++ b/tests/phpunit.integration.xml @@ -0,0 +1,14 @@ + + + + integration + + + + + ../ + + + diff --git a/tests/phpunit.unit.xml b/tests/phpunit.unit.xml new file mode 100644 index 0000000..1b5554d --- /dev/null +++ b/tests/phpunit.unit.xml @@ -0,0 +1,14 @@ + + + + unit + + + + + ../ + + + diff --git a/tests/phpunit.xml b/tests/phpunit.xml deleted file mode 100644 index 710e403..0000000 --- a/tests/phpunit.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - ./unit - - - ./integration - - - - - ./ - - - diff --git a/tests/scripts/phpunit.sh b/tests/scripts/phpunit.sh index 0f92356..bab4f16 100755 --- a/tests/scripts/phpunit.sh +++ b/tests/scripts/phpunit.sh @@ -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" diff --git a/tests/unit/controller/ApiControllerTest.php b/tests/unit/controller/ApiControllerTest.php index 0db35a4..c007247 100644 --- a/tests/unit/controller/ApiControllerTest.php +++ b/tests/unit/controller/ApiControllerTest.php @@ -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);