summaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-09-06 17:11:21 +0200
committerRobin Appelman <robin@icewind.nl>2017-09-06 17:12:19 +0200
commitccc41aedddeabf3e37cf621afe098d13104f5470 (patch)
treefcd3652c7416cd305c48a7f809e949c9ffecfe93 /apps/files_external/tests
parent6f7d200838082f84cd482c5f08612268c9378b9f (diff)
downloadnextcloud-server-ccc41aedddeabf3e37cf621afe098d13104f5470.tar.gz
nextcloud-server-ccc41aedddeabf3e37cf621afe098d13104f5470.zip
adjust tests to new failed storage handling
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r--apps/files_external/tests/Service/StoragesServiceTest.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/files_external/tests/Service/StoragesServiceTest.php b/apps/files_external/tests/Service/StoragesServiceTest.php
index 2776f24d5ab..056a03d24c8 100644
--- a/apps/files_external/tests/Service/StoragesServiceTest.php
+++ b/apps/files_external/tests/Service/StoragesServiceTest.php
@@ -22,10 +22,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
+
namespace OCA\Files_External\Tests\Service;
use \OC\Files\Filesystem;
+use OCA\Files_External\Lib\Auth\InvalidAuth;
+use OCA\Files_External\Lib\Backend\InvalidBackend;
use OCA\Files_External\NotFoundException;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Service\BackendService;
@@ -368,28 +371,24 @@ abstract class StoragesServiceTest extends \Test\TestCase {
$this->assertEquals($priority, $storage->getPriority());
}
- /**
- * @expectedException \InvalidArgumentException
- */
public function testCreateStorageInvalidClass() {
- $this->service->createStorage(
+ $storage = $this->service->createStorage(
'mount',
'identifier:\OC\Not\A\Backend',
'identifier:\Auth\Mechanism',
[]
);
+ $this->assertInstanceOf(InvalidBackend::class, $storage->getBackend());
}
- /**
- * @expectedException \InvalidArgumentException
- */
public function testCreateStorageInvalidAuthMechanismClass() {
- $this->service->createStorage(
+ $storage = $this->service->createStorage(
'mount',
'identifier:\OCA\Files_External\Lib\Backend\SMB',
'identifier:\Not\An\Auth\Mechanism',
[]
);
+ $this->assertInstanceOf(InvalidAuth::class, $storage->getAuthMechanism());
}
public function testGetStoragesBackendNotVisible() {