@@ -432,6 +432,41 @@ public function listLocalStorageMountOptions() {
432
432
$ this ->invokingTheCommand ('files_external:list --mount-options --output=json ' );
433
433
}
434
434
435
+ /**
436
+ * List available backends
437
+ *
438
+ * @return void
439
+ * @throws Exception
440
+ */
441
+ public function listAvailableBackends () {
442
+ $ this ->invokingTheCommand ('files_external:backends --output=json ' );
443
+ }
444
+
445
+ /**
446
+ * List available backends of type
447
+ *
448
+ * @param String $type
449
+ *
450
+ * @return void
451
+ * @throws Exception
452
+ */
453
+ public function listAvailableBackendsOfType ($ type ) {
454
+ $ this ->invokingTheCommand ('files_external:backends ' . $ type . ' --output=json ' );
455
+ }
456
+
457
+ /**
458
+ * List backend of type
459
+ *
460
+ * @param String $type
461
+ * @param String $backend
462
+ *
463
+ * @return void
464
+ * @throws Exception
465
+ */
466
+ public function listBackendOfType ($ type , $ backend ) {
467
+ $ this ->invokingTheCommand ('files_external:backends ' . $ type . ' ' . $ backend . ' --output=json ' );
468
+ }
469
+
435
470
/**
436
471
* List created local storage mount with --show-password
437
472
*
@@ -1273,6 +1308,41 @@ public function adminConfiguresLocalStorageMountUsingTheOccCommand($key, $value,
1273
1308
);
1274
1309
}
1275
1310
1311
+ /**
1312
+ * @When the administrator lists the available backends using the occ command
1313
+ *
1314
+ * @return void
1315
+ * @throws Exception
1316
+ */
1317
+ public function adminListsAvailableBackendsUsingTheOccCommand () {
1318
+ $ this ->listAvailableBackends ();
1319
+ }
1320
+
1321
+ /**
1322
+ * @When the administrator lists the available backends of type :type using the occ command
1323
+ *
1324
+ * @param String $type
1325
+ *
1326
+ * @return void
1327
+ * @throws Exception
1328
+ */
1329
+ public function adminListsAvailableBackendsOfTypeUsingTheOccCommand ($ type ) {
1330
+ $ this ->listAvailableBackendsOfType ($ type );
1331
+ }
1332
+
1333
+ /**
1334
+ * @When the adminstrator lists the :backend backend of type :backendType using the occ command
1335
+ *
1336
+ * @param String $backend
1337
+ * @param String $backendType
1338
+ *
1339
+ * @return void
1340
+ * @throws Exception
1341
+ */
1342
+ public function adminListsBackendOfTypeUsingTheOccCommand ($ backend , $ backendType ) {
1343
+ $ this ->listBackendOfType ($ backendType , $ backend );
1344
+ }
1345
+
1276
1346
/**
1277
1347
* @When the administrator lists configurations with the existing key :key for the local storage mount :localStorage
1278
1348
*
@@ -1406,6 +1476,108 @@ public function theFollowingLocalStoragesShouldNotExist(TableNode $mountPoints)
1406
1476
);
1407
1477
}
1408
1478
}
1479
+
1480
+ /**
1481
+ * @Then the following backend types should be listed:
1482
+ *
1483
+ * @param TableNode $table
1484
+ *
1485
+ * @return void
1486
+ * @throws Exception
1487
+ */
1488
+ public function theFollowingBackendTypesShouldBeListed ($ table ) {
1489
+ $ expectedBackendTypes = $ table ->getColumnsHash ();
1490
+ foreach ($ expectedBackendTypes as $ expectedBackendTypeEntry ) {
1491
+ Assert::assertArrayHasKey (
1492
+ 'backend-type ' ,
1493
+ $ expectedBackendTypeEntry ,
1494
+ __METHOD__
1495
+ . " The provided expected backend type entry ' "
1496
+ . \implode (', ' , $ expectedBackendTypeEntry )
1497
+ . "' do not have key 'backend-type' "
1498
+ );
1499
+ }
1500
+ $ commandOutput = \json_decode ($ this ->featureContext ->getStdOutOfOccCommand ());
1501
+ $ keys = \array_keys ((array ) $ commandOutput );
1502
+ foreach ($ expectedBackendTypes as $ backendTypesEntry ) {
1503
+ Assert::assertContains (
1504
+ $ backendTypesEntry ['backend-type ' ],
1505
+ $ keys ,
1506
+ __METHOD__
1507
+ . " $ {backendTypesEntry['backend-type ' ]} is not contained in ' "
1508
+ . \implode (', ' , $ keys )
1509
+ . "' but was expected to be. "
1510
+ );
1511
+ }
1512
+ }
1513
+
1514
+ /**
1515
+ * @Then the following authentication/storage backends should be listed:
1516
+ *
1517
+ * @param TableNode $table
1518
+ *
1519
+ * @return void
1520
+ * @throws Exception
1521
+ */
1522
+ public function theFollowingBackendsShouldBeListed ($ table ) {
1523
+ $ expectedBackends = $ table ->getColumnsHash ();
1524
+ foreach ($ expectedBackends as $ expectedBackendEntry ) {
1525
+ Assert::assertArrayHasKey (
1526
+ 'backends ' ,
1527
+ $ expectedBackendEntry ,
1528
+ __METHOD__
1529
+ . " The provided expected backend entry ' "
1530
+ . \implode (', ' , $ expectedBackendEntry )
1531
+ . "' do not have key 'backends' "
1532
+ );
1533
+ }
1534
+ $ commandOutput = \json_decode ($ this ->featureContext ->getStdOutOfOccCommand ());
1535
+ $ keys = \array_keys ((array ) $ commandOutput );
1536
+ foreach ($ expectedBackends as $ backendsEntry ) {
1537
+ Assert::assertContains (
1538
+ $ backendsEntry ['backends ' ],
1539
+ $ keys ,
1540
+ __METHOD__
1541
+ . " $ {backendsEntry['backends ' ]} is not contained in ' "
1542
+ . \implode (', ' , $ keys )
1543
+ . "' but was expected to be. "
1544
+ );
1545
+ }
1546
+ }
1547
+
1548
+ /**
1549
+ * @Then the following authentication/storage backend keys should be listed:
1550
+ *
1551
+ * @param TableNode $table
1552
+ *
1553
+ * @return void
1554
+ * @throws Exception
1555
+ */
1556
+ public function theFollowingBackendKeysOfTypeShouldBeListed ($ table ) {
1557
+ $ expectedBackendKeys = $ table ->getColumnsHash ();
1558
+ foreach ($ expectedBackendKeys as $ expectedBackendKeyEntry ) {
1559
+ Assert::assertArrayHasKey (
1560
+ 'backend-keys ' ,
1561
+ $ expectedBackendKeyEntry ,
1562
+ __METHOD__
1563
+ . " The provided expected backend key entry ' "
1564
+ . \implode (', ' , $ expectedBackendKeyEntry )
1565
+ . "' do not have key 'backend-keys' "
1566
+ );
1567
+ }
1568
+ $ commandOutput = \json_decode ($ this ->featureContext ->getStdOutOfOccCommand ());
1569
+ $ keys = \array_keys ((array ) $ commandOutput );
1570
+ foreach ($ expectedBackendKeys as $ backendKeysEntry ) {
1571
+ Assert::assertContains (
1572
+ $ backendKeysEntry ['backend-keys ' ],
1573
+ $ keys ,
1574
+ __METHOD__
1575
+ . " $ {backendKeysEntry['backend-keys ' ]} is not contained in ' "
1576
+ . \implode (', ' , $ keys )
1577
+ . "' but was expected to be. "
1578
+ );
1579
+ }
1580
+ }
1409
1581
1410
1582
/**
1411
1583
* @Then the following local storage should be listed:
0 commit comments