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
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Files/Storage/Wrapper/AvailabilityTest.php')
-rw-r--r--tests/lib/Files/Storage/Wrapper/AvailabilityTest.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php b/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php
index e8eb49ec014..f36958ad552 100644
--- a/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php
+++ b/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php
@@ -35,7 +35,7 @@ class AvailabilityTest extends \Test\TestCase {
/** @var Availability */
protected $wrapper;
- public function setUp(): void {
+ protected function setUp(): void {
parent::setUp();
$this->storageCache = $this->createMock(StorageCache::class);
@@ -66,9 +66,10 @@ class AvailabilityTest extends \Test\TestCase {
/**
* Storage marked unavailable, TTL not expired
*
- * @expectedException \OCP\Files\StorageNotAvailableException
*/
public function testUnavailable() {
+ $this->expectException(\OCP\Files\StorageNotAvailableException::class);
+
$this->storage->expects($this->once())
->method('getAvailability')
->willReturn(['available' => false, 'last_checked' => time()]);
@@ -105,9 +106,10 @@ class AvailabilityTest extends \Test\TestCase {
/**
* Storage marked available, but throws StorageNotAvailableException
*
- * @expectedException \OCP\Files\StorageNotAvailableException
*/
public function testAvailableThrowStorageNotAvailable() {
+ $this->expectException(\OCP\Files\StorageNotAvailableException::class);
+
$this->storage->expects($this->once())
->method('getAvailability')
->willReturn(['available' => true, 'last_checked' => 0]);
@@ -146,9 +148,10 @@ class AvailabilityTest extends \Test\TestCase {
* Storage available, but throws exception
* Standard exception does not indicate storage unavailability
*
- * @expectedException \Exception
*/
public function testAvailableThrow() {
+ $this->expectException(\Exception::class);
+
$this->storage->expects($this->once())
->method('getAvailability')
->willReturn(['available' => true, 'last_checked' => 0]);