From 4d71d37fe353c8870b6f4f50e21b37dbe0ae864c Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Mon, 10 Apr 2017 19:10:03 +0200 Subject: Reorganize method position inside class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For consistency with the rest of private methods in the class, "isContainerRegistered" is moved below the only public method in which it is used ("cleanUp"). Signed-off-by: Daniel Calviño Sánchez --- .../core/NextcloudTestServerDockerHelper.php | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/build/acceptance/features/core/NextcloudTestServerDockerHelper.php b/build/acceptance/features/core/NextcloudTestServerDockerHelper.php index 71c7f9ad850..69dafc2276b 100644 --- a/build/acceptance/features/core/NextcloudTestServerDockerHelper.php +++ b/build/acceptance/features/core/NextcloudTestServerDockerHelper.php @@ -191,6 +191,21 @@ class NextcloudTestServerDockerHelper { $this->executeDockerCommand("rm --volumes --force " . $this->containerName); } + /** + * Returns whether the container exists (no matter its state) or not. + * + * @return boolean true if the container exists, false otherwise. + * @throws \Exception if the Docker command failed to execute. + */ + private function isContainerRegistered() { + // With the "--quiet" option "docker ps" only shows the ID of the + // matching containers, without table headers. Therefore, if the + // container does not exist the output will be empty (not even a new + // line, as the last line of output returned by "executeDockerCommand" + // does not include a trailing new line character). + return $this->executeDockerCommand("ps --all --quiet --filter 'name=" . $this->containerName . "'") !== ""; + } + /** * Returns the base URL of the Nextcloud test server. * @@ -214,21 +229,6 @@ class NextcloudTestServerDockerHelper { return $this->executeDockerCommand("port " . $this->containerName . " 80"); } - /** - * Returns whether the container exists (no matter its state) or not. - * - * @return boolean true if the container exists, false otherwise. - * @throws \Exception if the Docker command failed to execute. - */ - private function isContainerRegistered() { - // With the "--quiet" option "docker ps" only shows the ID of the - // matching containers, without table headers. Therefore, if the - // container does not exist the output will be empty (not even a new - // line, as the last line of output returned by "executeDockerCommand" - // does not include a trailing new line character). - return $this->executeDockerCommand("ps --all --quiet --filter 'name=" . $this->containerName . "'") !== ""; - } - /** * Executes the given Docker command. * -- cgit v1.2.3