diff --git a/.drone.yml b/.drone.yml index e083659..edf93cd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -46,7 +46,7 @@ steps: - cd tests/unit/ - phpunit --configuration phpunit.xml - name: php7.3 - image: nextcloudci/php7.3:php7.3-1 + image: nextcloudci/php7.3:php7.3-5 environment: APP_NAME: user_saml CORE_BRANCH: master @@ -81,137 +81,48 @@ trigger: event: - pull_request - push - --- kind: pipeline -name: tests-17 +name: tests-18 clone: - depth: 1 + depth: 1 steps: - - name: php7.2-stable17 - image: nextcloudci/php7.2:php7.2-13 - environment: - APP_NAME: user_saml - CORE_BRANCH: stable17 - DB: sqlite - commands: - - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - - cd ../server/apps/$APP_NAME - - cd tests/unit/ - - phpunit --configuration phpunit.xml - - name: integration-tests-stable16 - image: nextcloudci/user_saml_shibboleth-php7.2:user_saml_shibboleth_php7.2-2 - environment: - CORE_BRANCH: stable17 - commands: - - sed -i 's_/etc/init.d/jetty run \&_sleep 4 \&\& /etc/init.d/jetty run \&_' /start.sh - - /start.sh & - - sleep 7 - - rm -rf /var/www/html - - cd /var/www/ - - git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html - - cd /var/www/html && git submodule update --init - # use local clone - - cp -r /drone/src /var/www/html/apps/user_saml - - scl enable rh-php72 "bash -c 'php /var/www/html/occ maintenance:install --database sqlite --admin-pass password; php /var/www/html/occ app:enable user_saml'" - - chown -R apache:apache /var/www/html/ - - scl enable rh-php72 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'" + - name: php7.3-stable18 + image: nextcloudci/php7.3:php7.3-5 + environment: + APP_NAME: user_saml + CORE_BRANCH: stable18 + DB: sqlite + commands: + - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh + - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB + - cd ../server/apps/$APP_NAME + - cd tests/unit/ + - phpunit --configuration phpunit.xml + - name: integration-tests-stable18 + image: nextcloudci/user_saml_shibboleth-php7.2:user_saml_shibboleth_php7.2-2 + environment: + CORE_BRANCH: stable18 + commands: + - sed -i 's_/etc/init.d/jetty run \&_sleep 4 \&\& /etc/init.d/jetty run \&_' /start.sh + - /start.sh & + - sleep 7 + - rm -rf /var/www/html + - cd /var/www/ + - git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html + - cd /var/www/html && git submodule update --init + # use local clone + - cp -r /drone/src /var/www/html/apps/user_saml + - scl enable rh-php72 "bash -c 'php /var/www/html/occ maintenance:install --database sqlite --admin-pass password; php /var/www/html/occ app:enable user_saml'" + - chown -R apache:apache /var/www/html/ + - scl enable rh-php72 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'" trigger: - branch: - - master - event: - - pull_request - - push + branch: + - master + event: + - pull_request + - push ---- -kind: pipeline -name: tests-16 - -clone: - depth: 1 - -steps: - - name: php7.1-stable16 - image: nextcloudci/php7.1:php7.1-16 - environment: - APP_NAME: user_saml - CORE_BRANCH: stable16 - DB: sqlite - commands: - - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - - cd ../server/apps/$APP_NAME - - cd tests/unit/ - - phpunit --configuration phpunit.xml - - name: integration-tests-stable16 - image: nextcloudci/user_saml_shibboleth-php7.2:user_saml_shibboleth_php7.2-2 - environment: - CORE_BRANCH: stable16 - commands: - - sed -i 's_/etc/init.d/jetty run \&_sleep 4 \&\& /etc/init.d/jetty run \&_' /start.sh - - /start.sh & - - sleep 7 - - rm -rf /var/www/html - - cd /var/www/ - - git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html - - cd /var/www/html && git submodule update --init - # use local clone - - cp -r /drone/src /var/www/html/apps/user_saml - - scl enable rh-php72 "bash -c 'php /var/www/html/occ maintenance:install --database sqlite --admin-pass password; php /var/www/html/occ app:enable user_saml'" - - chown -R apache:apache /var/www/html/ - - scl enable rh-php72 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'" - -trigger: - branch: - - master - event: - - pull_request - - push - ---- -kind: pipeline -name: tests-15 - -clone: - depth: 1 - -steps: - - name: php7.0-stable15 - image: nextcloudci/php7.0:php7.0-19 - environment: - APP_NAME: user_saml - CORE_BRANCH: stable15 - DB: sqlite - commands: - - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - - cd ../server/apps/$APP_NAME - - cd tests/unit/ - - phpunit --configuration phpunit.xml - - name: integration-tests-stable15 - image: nextcloudci/user_saml_shibboleth-php7:user_saml_shibboleth_php7-5 - environment: - CORE_BRANCH: stable15 - commands: - - /start.sh & - - sleep 3 - - rm -rf /var/www/html - - cd /var/www/ - - git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html - - cd /var/www/html && git submodule update --init - # use local clone - - cp -r /drone/src /var/www/html/apps/user_saml - - scl enable rh-php70 "bash -c 'php /var/www/html/occ maintenance:install --database sqlite --admin-pass password; php /var/www/html/occ app:enable user_saml'" - - chown -R apache:apache /var/www/html/ - - scl enable rh-php70 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'" - -trigger: - branch: - - master - event: - - pull_request - - push diff --git a/appinfo/info.xml b/appinfo/info.xml index 493109f..24b4fa1 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -33,7 +33,7 @@ While theoretically any other authentication provider implementing either one of https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/1.png https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/2.png - + OCA\User_SAML\Settings\Admin diff --git a/tests/unit/AppInfo/ApplicationTest.php b/tests/unit/AppInfo/ApplicationTest.php index 69ca49b..27fba0a 100644 --- a/tests/unit/AppInfo/ApplicationTest.php +++ b/tests/unit/AppInfo/ApplicationTest.php @@ -34,7 +34,7 @@ class ApplicationTest extends \Test\TestCase { /** @var \OCP\AppFramework\IAppContainer */ protected $container; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->app = new Application(); $this->container = $this->app->getContainer(); diff --git a/tests/unit/Controller/SAMLControllerTest.php b/tests/unit/Controller/SAMLControllerTest.php index 952e24b..8a7877f 100644 --- a/tests/unit/Controller/SAMLControllerTest.php +++ b/tests/unit/Controller/SAMLControllerTest.php @@ -61,7 +61,7 @@ class SAMLControllerTest extends TestCase { /** @var SAMLController */ private $samlController; - public function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->createMock(IRequest::class); diff --git a/tests/unit/Middleware/OnlyLoggedInMiddlewareTest.php b/tests/unit/Middleware/OnlyLoggedInMiddlewareTest.php index 37e721f..30daa45 100644 --- a/tests/unit/Middleware/OnlyLoggedInMiddlewareTest.php +++ b/tests/unit/Middleware/OnlyLoggedInMiddlewareTest.php @@ -35,7 +35,7 @@ class OnlyLoggedInMiddlewareTest extends \Test\TestCase { /** @var OnlyLoggedInMiddleware */ private $onlyLoggedInMiddleware; - public function setUp() { + protected function setUp(): void { $this->reflector = $this->createMock(IControllerMethodReflector::class); $this->userSession = $this->createMock(IUserSession::class); $this->onlyLoggedInMiddleware = new OnlyLoggedInMiddleware( @@ -43,7 +43,7 @@ class OnlyLoggedInMiddlewareTest extends \Test\TestCase { $this->userSession ); - return parent::setUp(); + parent::setUp(); } public function testBeforeControllerWithoutAnnotation() { diff --git a/tests/unit/Settings/AdminTest.php b/tests/unit/Settings/AdminTest.php index e061de5..4ee60d5 100644 --- a/tests/unit/Settings/AdminTest.php +++ b/tests/unit/Settings/AdminTest.php @@ -37,7 +37,7 @@ class AdminTest extends \Test\TestCase { /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */ private $config; - public function setUp() { + protected function setUp(): void { $this->l10n = $this->createMock(IL10N::class); $this->defaults = $this->createMock(Defaults::class); $this->config = $this->createMock(IConfig::class); @@ -48,7 +48,7 @@ class AdminTest extends \Test\TestCase { $this->config ); - return parent::setUp(); + parent::setUp(); } public function formDataProvider() { diff --git a/tests/unit/Settings/SectionTest.php b/tests/unit/Settings/SectionTest.php index 2bb84d8..e0253ce 100644 --- a/tests/unit/Settings/SectionTest.php +++ b/tests/unit/Settings/SectionTest.php @@ -32,7 +32,7 @@ class SectionTest extends \Test\TestCase { /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */ private $urlGenerator; - public function setUp() { + protected function setUp(): void { $this->l10n = $this->createMock(\OCP\IL10N::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->section = new \OCA\User_SAML\Settings\Section( @@ -40,7 +40,7 @@ class SectionTest extends \Test\TestCase { $this->urlGenerator ); - return parent::setUp(); + parent::setUp(); } public function testGetId() { diff --git a/tests/unit/UserBackendTest.php b/tests/unit/UserBackendTest.php index 28bd435..f6326ed 100644 --- a/tests/unit/UserBackendTest.php +++ b/tests/unit/UserBackendTest.php @@ -54,7 +54,7 @@ class UserBackendTest extends TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject|ILogger */ private $logger; - public function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class);