Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-19 12:32:11 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-03-09 14:26:58 +0300
commit0709f4fd67145f3ce638d3699c835bee6b2a8e32 (patch)
tree040c08514c3b110b703b1db54f8aa8b886c19435 /tests
parentda6743277b005dbef79dc523d6396ee580e0ed21 (diff)
Store the name of the actor in the Actor object
This is needed to be able to easily use the actor as a key in an array. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/acceptance/features/core/Actor.php18
-rw-r--r--tests/acceptance/features/core/ActorContext.php4
2 files changed, 19 insertions, 3 deletions
diff --git a/tests/acceptance/features/core/Actor.php b/tests/acceptance/features/core/Actor.php
index bf2f5a7367d..f47373593e9 100644
--- a/tests/acceptance/features/core/Actor.php
+++ b/tests/acceptance/features/core/Actor.php
@@ -61,6 +61,11 @@
class Actor {
/**
+ * @var string
+ */
+ private $name;
+
+ /**
* @var \Behat\Mink\Session
*/
private $session;
@@ -83,12 +88,14 @@ class Actor {
/**
* Creates a new Actor.
*
+ * @param string $name the name of the actor.
* @param \Behat\Mink\Session $session the Mink Session used to control its
* web browser.
* @param string $baseUrl the base URL used when solving relative URLs.
* @param array $sharedNotebook the notebook shared between all actors.
*/
- public function __construct(\Behat\Mink\Session $session, $baseUrl, &$sharedNotebook) {
+ public function __construct($name, \Behat\Mink\Session $session, $baseUrl, &$sharedNotebook) {
+ $this->name = $name;
$this->session = $session;
$this->baseUrl = $baseUrl;
$this->sharedNotebook = &$sharedNotebook;
@@ -96,6 +103,15 @@ class Actor {
}
/**
+ * Returns the name of this Actor.
+ *
+ * @return string the name of this Actor.
+ */
+ public function getName() {
+ return $this->name;
+ }
+
+ /**
* Sets the base URL.
*
* @param string $baseUrl the base URL used when solving relative URLs.
diff --git a/tests/acceptance/features/core/ActorContext.php b/tests/acceptance/features/core/ActorContext.php
index d6fb63694ec..2cdc4b01ff1 100644
--- a/tests/acceptance/features/core/ActorContext.php
+++ b/tests/acceptance/features/core/ActorContext.php
@@ -135,7 +135,7 @@ class ActorContext extends RawMinkContext {
$this->actors = array();
$this->sharedNotebook = array();
- $this->actors["default"] = new Actor($this->getSession(), $this->getMinkParameter("base_url"), $this->sharedNotebook);
+ $this->actors["default"] = new Actor("default", $this->getSession(), $this->getMinkParameter("base_url"), $this->sharedNotebook);
$this->actors["default"]->setFindTimeoutMultiplier($this->actorTimeoutMultiplier);
$this->currentActor = $this->actors["default"];
@@ -159,7 +159,7 @@ class ActorContext extends RawMinkContext {
*/
public function iActAs($actorName) {
if (!array_key_exists($actorName, $this->actors)) {
- $this->actors[$actorName] = new Actor($this->getSession($actorName), $this->getMinkParameter("base_url"), $this->sharedNotebook);
+ $this->actors[$actorName] = new Actor($actorName, $this->getSession($actorName), $this->getMinkParameter("base_url"), $this->sharedNotebook);
$this->actors[$actorName]->setFindTimeoutMultiplier($this->actorTimeoutMultiplier);
}