summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-07-20 07:50:33 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-07-20 07:50:33 +0200
commit8e9c12eed92642748111bbc2acaf4bf071526a43 (patch)
tree3ab0d01252e3b68c504da8f90fab588ddc4cca8c /tests
parent3ff3c338c93c9d308f8160e28af08f3c59e9dbcc (diff)
downloadnextcloud-server-8e9c12eed92642748111bbc2acaf4bf071526a43.tar.gz
nextcloud-server-8e9c12eed92642748111bbc2acaf4bf071526a43.zip
Make possible to configure the domain for the Nextcloud test server
The NextcloudTestServerLocalHelper started the PHP built-in web server for the Nextcloud test server at 127.0.0.1; as the Selenium server has to access the Nextcloud test server they were forced to share the same network. Now, the domain at which the PHP built-in web server is started can be specified when the NextcloudTestServerLocalHelper is created, which removes the need of sharing the same network, as the Selenium server now can access the Nextcloud test server at an arbitrary domain. However, by default "127.0.0.1" is still used if no domain is given. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/acceptance/features/core/NextcloudTestServerLocalHelper.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/acceptance/features/core/NextcloudTestServerLocalHelper.php b/tests/acceptance/features/core/NextcloudTestServerLocalHelper.php
index 32b5330c61a..b11a9ae8217 100644
--- a/tests/acceptance/features/core/NextcloudTestServerLocalHelper.php
+++ b/tests/acceptance/features/core/NextcloudTestServerLocalHelper.php
@@ -35,9 +35,12 @@
* the Nextcloud server; the last commit in that Git repository must provide the
* initial state for the Nextcloud server expected by the acceptance tests.
*
- * The Nextcloud server is available at "127.0.0.1", so it is expected to see
- * "127.0.0.1" as a trusted domain (which would be the case if it was installed
- * by running "occ maintenance:install"). The base URL to access the Nextcloud
+ * The Nextcloud server is available at "$nextcloudServerDomain", which can be
+ * optionally specified when the NextcloudTestServerLocalHelper is created; if
+ * no value is given "127.0.0.1" is used by default. In any case, the value of
+ * "$nextcloudServerDomain" must be seen as a trusted domain by the Nextcloud
+ * server (which would be the case for "127.0.0.1" if it was installed by
+ * running "occ maintenance:install"). The base URL to access the Nextcloud
* server can be got from "getBaseUrl".
*/
class NextcloudTestServerLocalHelper implements NextcloudTestServerHelper {
@@ -45,12 +48,19 @@ class NextcloudTestServerLocalHelper implements NextcloudTestServerHelper {
/**
* @var string
*/
+ private $nextcloudServerDomain;
+
+ /**
+ * @var string
+ */
private $phpServerPid;
/**
* Creates a new NextcloudTestServerLocalHelper.
*/
- public function __construct() {
+ public function __construct($nextcloudServerDomain = "127.0.0.1") {
+ $this->nextcloudServerDomain = $nextcloudServerDomain;
+
$this->phpServerPid = "";
}
@@ -77,7 +87,7 @@ class NextcloudTestServerLocalHelper implements NextcloudTestServerHelper {
// execOrException is not used because the server is started in the
// background, so the command will always succeed even if the server
// itself fails.
- $this->phpServerPid = exec("php -S 127.0.0.1:80 -t ../../ >/dev/null 2>&1 & echo $!");
+ $this->phpServerPid = exec("php -S " . $this->nextcloudServerDomain . ":80 -t ../../ >/dev/null 2>&1 & echo $!");
$timeout = 60;
if (!Utils::waitForServer($this->getBaseUrl(), $timeout)) {
@@ -100,7 +110,7 @@ class NextcloudTestServerLocalHelper implements NextcloudTestServerHelper {
* @return string the base URL of the Nextcloud test server.
*/
public function getBaseUrl() {
- return "http://127.0.0.1/index.php";
+ return "http://" . $this->nextcloudServerDomain . "/index.php";
}
/**