summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin McCorkell <robin@mccorkell.me.uk>2016-04-26 22:30:09 +0100
committerRobin McCorkell <robin@mccorkell.me.uk>2016-04-26 22:30:09 +0100
commit77cec29b108df7d9c868d60baf74fbe9b64e08f5 (patch)
tree4aed288c81298015c85ec8f14acb54f5345e061b /tests
parentddbebe91f0ea0c6a938991b929ffdb71bbb2cc16 (diff)
downloadnextcloud-server-77cec29b108df7d9c868d60baf74fbe9b64e08f5.tar.gz
nextcloud-server-77cec29b108df7d9c868d60baf74fbe9b64e08f5.zip
Prevent concurrent availability checks
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/storage/wrapper/availability.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/lib/files/storage/wrapper/availability.php b/tests/lib/files/storage/wrapper/availability.php
index 9b394df8ca3..99d6f7dbe5c 100644
--- a/tests/lib/files/storage/wrapper/availability.php
+++ b/tests/lib/files/storage/wrapper/availability.php
@@ -74,9 +74,12 @@ class Availability extends \Test\TestCase {
$storage->expects($this->once())
->method('test')
->willReturn(true);
- $storage->expects($this->once())
+ $storage->expects($this->exactly(2))
->method('setAvailability')
- ->with($this->equalTo(true));
+ ->withConsecutive(
+ [$this->equalTo(false)], // prevents concurrent rechecks
+ [$this->equalTo(true)] // sets correct availability
+ );
$storage->expects($this->once())
->method('mkdir');