mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-04-26 06:20:08 +02:00
Merge pull request #535 from nextcloud/update-master-version
Update version on master
This commit is contained in:
commit
cb5e0fa7c8
232
.drone.yml
232
.drone.yml
|
@ -27,6 +27,66 @@ trigger:
|
|||
|
||||
type: docker
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: compatibility-22
|
||||
|
||||
clone:
|
||||
depth: 1
|
||||
|
||||
steps:
|
||||
- name: app-code-check
|
||||
image: nextcloudci/php7.3:php7.3-5
|
||||
environment:
|
||||
APP_NAME: user_saml
|
||||
CORE_BRANCH: stable22
|
||||
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
|
||||
- ./occ app:check-code $APP_NAME -c strong-comparison -c deprecation
|
||||
- cd apps/$APP_NAME/
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- pull_request
|
||||
- push
|
||||
|
||||
type: docker
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: compatibility-21
|
||||
|
||||
clone:
|
||||
depth: 1
|
||||
|
||||
steps:
|
||||
- name: app-code-check
|
||||
image: nextcloudci/php7.3:php7.3-5
|
||||
environment:
|
||||
APP_NAME: user_saml
|
||||
CORE_BRANCH: stable21
|
||||
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
|
||||
- ./occ app:check-code $APP_NAME -c strong-comparison -c deprecation
|
||||
- cd apps/$APP_NAME/
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- pull_request
|
||||
- push
|
||||
|
||||
type: docker
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: tests-master
|
||||
|
@ -59,6 +119,18 @@ steps:
|
|||
- cd ../server/apps/$APP_NAME
|
||||
- cd tests/unit/
|
||||
- phpunit --configuration phpunit.xml
|
||||
- name: php8.0
|
||||
image: nextcloudci/php8.0:latest
|
||||
environment:
|
||||
APP_NAME: user_saml
|
||||
CORE_BRANCH: master
|
||||
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
|
||||
|
||||
type: docker
|
||||
|
||||
|
@ -96,3 +168,163 @@ trigger:
|
|||
|
||||
type: docker
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: tests-22
|
||||
|
||||
clone:
|
||||
depth: 1
|
||||
|
||||
steps:
|
||||
- name: php7.3
|
||||
image: nextcloudci/php7.3:php7.3-5
|
||||
environment:
|
||||
APP_NAME: user_saml
|
||||
CORE_BRANCH: stable22
|
||||
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: php7.4
|
||||
image: nextcloudci/php7.4:php7.4-2
|
||||
environment:
|
||||
APP_NAME: user_saml
|
||||
CORE_BRANCH: stable22
|
||||
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: php8.0
|
||||
image: nextcloudci/php8.0:latest
|
||||
environment:
|
||||
APP_NAME: user_saml
|
||||
CORE_BRANCH: stable22
|
||||
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
|
||||
|
||||
type: docker
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: integration-tests-stable22
|
||||
|
||||
clone:
|
||||
depth: 1
|
||||
|
||||
steps:
|
||||
- name: integration-tests-master
|
||||
image: nextcloudci/user_saml_shibboleth-php7.3:user_saml_shibboleth_php7.3-2
|
||||
environment:
|
||||
CORE_BRANCH: stable22
|
||||
commands:
|
||||
- /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-php73 "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-php73 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- pull_request
|
||||
- push
|
||||
|
||||
type: docker
|
||||
---
|
||||
kind: pipeline
|
||||
name: tests-21
|
||||
|
||||
clone:
|
||||
depth: 1
|
||||
|
||||
steps:
|
||||
- name: php7.3
|
||||
image: nextcloudci/php7.3:php7.3-5
|
||||
environment:
|
||||
APP_NAME: user_saml
|
||||
CORE_BRANCH: stable21
|
||||
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: php7.4
|
||||
image: nextcloudci/php7.4:php7.4-2
|
||||
environment:
|
||||
APP_NAME: user_saml
|
||||
CORE_BRANCH: stable21
|
||||
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: php8.0
|
||||
image: nextcloudci/php8.0:latest
|
||||
environment:
|
||||
APP_NAME: user_saml
|
||||
CORE_BRANCH: stable21
|
||||
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
|
||||
|
||||
type: docker
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: integration-tests-stable21
|
||||
|
||||
clone:
|
||||
depth: 1
|
||||
|
||||
steps:
|
||||
- name: integration-tests-master
|
||||
image: nextcloudci/user_saml_shibboleth-php7.3:user_saml_shibboleth_php7.3-2
|
||||
environment:
|
||||
CORE_BRANCH: stable21
|
||||
commands:
|
||||
- /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-php73 "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-php73 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- pull_request
|
||||
- push
|
||||
|
||||
type: docker
|
||||
|
|
|
@ -16,7 +16,7 @@ The following providers are supported and tested at the moment:
|
|||
* Any other provider that authenticates using the environment variable
|
||||
|
||||
While theoretically any other authentication provider implementing either one of those standards is compatible, we like to note that they are not part of any internal test matrix.]]></description>
|
||||
<version>4.1.1</version>
|
||||
<version>4.2.0</version>
|
||||
<licence>agpl</licence>
|
||||
<author>Lukas Reschke</author>
|
||||
<namespace>User_SAML</namespace>
|
||||
|
@ -33,7 +33,7 @@ While theoretically any other authentication provider implementing either one of
|
|||
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/1.png</screenshot>
|
||||
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/2.png</screenshot>
|
||||
<dependencies>
|
||||
<nextcloud min-version="21" max-version="22" />
|
||||
<nextcloud min-version="21" max-version="23" />
|
||||
</dependencies>
|
||||
<commands>
|
||||
<command>OCA\User_SAML\Command\GetMetadata</command>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace OCA\User_SAML\Tests\Controller;
|
||||
|
||||
use Exception;
|
||||
use OCA\User_SAML\Controller\SAMLController;
|
||||
use OCA\User_SAML\Exceptions\NoUserFoundException;
|
||||
use OCA\User_SAML\SAMLSettings;
|
||||
|
@ -114,16 +115,16 @@ class SAMLControllerTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedExceptionMessage Type of "UnknownValue" is not supported for user_saml
|
||||
* @expectedException \Exception
|
||||
*/
|
||||
public function testLoginWithInvalidAppValue() {
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getAppValue')
|
||||
->with('user_saml', 'type')
|
||||
->willReturn('UnknownValue');
|
||||
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectExceptionMessage('Type of "UnknownValue" is not supported for user_saml');
|
||||
|
||||
$this->samlController->login(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace OCA\User_SAML\Tests\Middleware;
|
||||
|
||||
use Exception;
|
||||
use OCA\User_SAML\Middleware\OnlyLoggedInMiddleware;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
|
@ -79,10 +80,6 @@ class OnlyLoggedInMiddlewareTest extends \Test\TestCase {
|
|||
$this->onlyLoggedInMiddleware->beforeController($this->createMock(Controller::class), 'bar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Exception
|
||||
* @expectedExceptionMessage User is already logged-in
|
||||
*/
|
||||
public function testBeforeControllerWithAnnotationAndLoggedIn() {
|
||||
$this->reflector
|
||||
->expects($this->once())
|
||||
|
@ -94,15 +91,19 @@ class OnlyLoggedInMiddlewareTest extends \Test\TestCase {
|
|||
->method('isLoggedIn')
|
||||
->willReturn(true);
|
||||
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectExceptionMessage('User is already logged-in');
|
||||
|
||||
$this->onlyLoggedInMiddleware->beforeController($this->createMock(Controller::class), 'bar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Exception
|
||||
* @expectedExceptionMessage My Exception
|
||||
*/
|
||||
public function testAfterExceptionWithNormalException() {
|
||||
$exception = new \Exception('My Exception');
|
||||
$exceptionMsg = 'My Exception';
|
||||
$exception = new Exception($exceptionMsg);
|
||||
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectExceptionMessage($exceptionMsg);
|
||||
|
||||
$this->onlyLoggedInMiddleware->afterException($this->createMock(Controller::class), 'bar', $exception);
|
||||
}
|
||||
|
||||
|
@ -113,7 +114,7 @@ class OnlyLoggedInMiddlewareTest extends \Test\TestCase {
|
|||
->with('/')
|
||||
->willReturn($homeUrl);
|
||||
|
||||
$exception = new \Exception('User is already logged-in');
|
||||
$exception = new Exception('User is already logged-in');
|
||||
$expected = new RedirectResponse($homeUrl);
|
||||
$this->assertEquals($expected, $this->onlyLoggedInMiddleware->afterException($this->createMock(Controller::class), 'bar', $exception));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue