mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 18:11:02 -04:00
Add integration tests
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
aacbb560ae
commit
b882f65fbb
3 changed files with 51 additions and 0 deletions
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use GuzzleHttp\Exception\ServerException;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
|
@ -68,6 +69,8 @@ trait Auth {
|
|||
$this->response = $this->client->send($request);
|
||||
} catch (ClientException $ex) {
|
||||
$this->response = $ex->getResponse();
|
||||
} catch (ServerException $ex) {
|
||||
$this->response = $ex->getResponse();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,20 @@ class CommandLineContext implements \Behat\Behat\Context\Context {
|
|||
$this->remoteBaseUrl = $baseUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given Maintenance mode is enabled
|
||||
*/
|
||||
public function maintenanceModeIsEnabled() {
|
||||
$this->runOcc(['maintenance:mode', '--on']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then Maintenance mode is disabled
|
||||
*/
|
||||
public function maintenanceModeIsDisabled() {
|
||||
$this->runOcc(['maintenance:mode', '--off']);
|
||||
}
|
||||
|
||||
/** @BeforeScenario */
|
||||
public function gatherContexts(BeforeScenarioScope $scope) {
|
||||
$environment = $scope->getEnvironment();
|
||||
|
|
|
|||
34
build/integration/features/maintenance-mode.feature
Normal file
34
build/integration/features/maintenance-mode.feature
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
Feature: maintenance-mode
|
||||
|
||||
Background:
|
||||
Given Maintenance mode is enabled
|
||||
|
||||
Scenario: Accessing /index.php with maintenance mode enabled
|
||||
When requesting "/index.php" with "GET"
|
||||
Then the HTTP status code should be "503"
|
||||
Then Maintenance mode is disabled
|
||||
|
||||
Scenario: Accessing /remote.php/webdav with maintenance mode enabled
|
||||
When requesting "/remote.php/webdav" with "GET"
|
||||
Then the HTTP status code should be "503"
|
||||
Then Maintenance mode is disabled
|
||||
|
||||
Scenario: Accessing /remote.php/dav with maintenance mode enabled
|
||||
When requesting "/remote.php/dav" with "GET"
|
||||
Then the HTTP status code should be "503"
|
||||
Then Maintenance mode is disabled
|
||||
|
||||
Scenario: Accessing /ocs/v1.php with maintenance mode enabled
|
||||
When requesting "/ocs/v1.php" with "GET"
|
||||
Then the HTTP status code should be "503"
|
||||
Then Maintenance mode is disabled
|
||||
|
||||
Scenario: Accessing /ocs/v2.php with maintenance mode enabled
|
||||
When requesting "/ocs/v2.php" with "GET"
|
||||
Then the HTTP status code should be "503"
|
||||
Then Maintenance mode is disabled
|
||||
|
||||
Scenario: Accessing /public.php/webdav with maintenance mode enabled
|
||||
When requesting "/public.php/webdav" with "GET"
|
||||
Then the HTTP status code should be "503"
|
||||
Then Maintenance mode is disabled
|
||||
Loading…
Reference in a new issue