summaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-12-29 19:48:38 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-12-30 06:01:38 +0100
commit28f2d0ec7a51fdeab1d7294346ad8c3bc92cb6c6 (patch)
tree2647f722cf7188907437dc4ac3ae559c8927f284 /build/integration/features/bootstrap
parent4c01f0da8f76635e5642eb46e4eb0f0fcaa322ca (diff)
downloadnextcloud-server-28f2d0ec7a51fdeab1d7294346ad8c3bc92cb6c6.tar.gz
nextcloud-server-28f2d0ec7a51fdeab1d7294346ad8c3bc92cb6c6.zip
Make integration tests work with both PHP 7.3 and 7.4
The "Trashbin" and "WebDav" traits were using each other in a circular dependency ("WebDav" -> "Sharing" -> "Provisioning" -> "BasicStructure" -> "Trashbin" -> "WebDav"). In PHP 7.3 this worked fine, but in PHP 7.4 the fatal error "Trait 'WebDav' not found in .../Trashbin.php" was thrown. To solve this now the "TrashBin" trait no longer explicitly uses "WebDav". However, due to this change, the class using "TrashBin" is now expected to also use "WebDav". As the "Trashbin" trait was not needed by most contexts using the "BasicStructure" trait "Trashbin" was removed from it and added only to those contexts that actually need it. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'build/integration/features/bootstrap')
-rw-r--r--build/integration/features/bootstrap/BasicStructure.php1
-rw-r--r--build/integration/features/bootstrap/FeatureContext.php1
-rw-r--r--build/integration/features/bootstrap/SharingContext.php3
-rw-r--r--build/integration/features/bootstrap/Trashbin.php3
4 files changed, 5 insertions, 3 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php
index c8c40d2a98b..fcccddc318f 100644
--- a/build/integration/features/bootstrap/BasicStructure.php
+++ b/build/integration/features/bootstrap/BasicStructure.php
@@ -47,7 +47,6 @@ trait BasicStructure {
use Avatar;
use Download;
use Mail;
- use Trashbin;
/** @var string */
private $currentUser = '';
diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php
index 66e2282608e..e9c486daa4d 100644
--- a/build/integration/features/bootstrap/FeatureContext.php
+++ b/build/integration/features/bootstrap/FeatureContext.php
@@ -35,4 +35,5 @@ require __DIR__ . '/../../vendor/autoload.php';
class FeatureContext implements Context, SnippetAcceptingContext {
use Search;
use WebDav;
+ use Trashbin;
}
diff --git a/build/integration/features/bootstrap/SharingContext.php b/build/integration/features/bootstrap/SharingContext.php
index b1a4c1aa48b..be719cbf379 100644
--- a/build/integration/features/bootstrap/SharingContext.php
+++ b/build/integration/features/bootstrap/SharingContext.php
@@ -32,7 +32,8 @@ require __DIR__ . '/../../vendor/autoload.php';
* Features context.
*/
class SharingContext implements Context, SnippetAcceptingContext {
- use Sharing;
+ use WebDav;
+ use Trashbin;
use AppConfiguration;
use CommandLine;
diff --git a/build/integration/features/bootstrap/Trashbin.php b/build/integration/features/bootstrap/Trashbin.php
index 3eb6ce812ec..536ed6a9015 100644
--- a/build/integration/features/bootstrap/Trashbin.php
+++ b/build/integration/features/bootstrap/Trashbin.php
@@ -30,7 +30,8 @@ require __DIR__ . '/../../vendor/autoload.php';
* Trashbin functions
*/
trait Trashbin {
- use WebDav;
+
+ // WebDav trait is expected to be used in the class that uses this trait.
/**
* @When User :user empties trashbin