private function BackupMigratePermissionsTest::checkPathsWithUser in Backup and Migrate 8.4
Same name and namespace in other branches
- 5.0.x tests/src/Functional/BackupMigratePermissionsTest.php \Drupal\Tests\backup_migrate\Functional\BackupMigratePermissionsTest::checkPathsWithUser()
Check a set of paths to see if they are accessible for a given permission.
Parameters
array $ok_paths: The paths that are expected return a 200 response, all others are expected to return a 403 response.
array $permissions: All of the permissions that are to be tested for this set of paths.
5 calls to BackupMigratePermissionsTest::checkPathsWithUser()
- BackupMigratePermissionsTest::testAccessBackupFiles in tests/
src/ Functional/ BackupMigratePermissionsTest.php - Tests access for 'access backup files' permission.
- BackupMigratePermissionsTest::testAdminister in tests/
src/ Functional/ BackupMigratePermissionsTest.php - Tests access for 'administer backup and migrate' permission.
- BackupMigratePermissionsTest::testAuthenticated in tests/
src/ Functional/ BackupMigratePermissionsTest.php - Tests access for an authenticated user without any permissions.
- BackupMigratePermissionsTest::testPerformBackup in tests/
src/ Functional/ BackupMigratePermissionsTest.php - Tests access for 'perform backup' permission.
- BackupMigratePermissionsTest::testRestoreFromBackup in tests/
src/ Functional/ BackupMigratePermissionsTest.php - Tests access for 'restore from backup' permission.
File
- tests/
src/ Functional/ BackupMigratePermissionsTest.php, line 71
Class
- BackupMigratePermissionsTest
- Tests backup migrate permissions functionality.
Namespace
Drupal\Tests\backup_migrate\FunctionalCode
private function checkPathsWithUser(array $ok_paths = [], array $permissions = []) {
// Before running the tests log in with the requested permissions.
$this
->drupalLogin($this
->drupalCreateUser($permissions));
// Run the path tests.
$this
->checkPaths($ok_paths);
}