You are here

public function S3fsConfigValidationTest::testReadOnlySetting in S3 File System 4.0.x

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/S3fsConfigValidationTest.php \Drupal\Tests\s3fs\Functional\S3fsConfigValidationTest::testReadOnlySetting()

Coverage test for read only bucket configuration.

File

tests/src/Functional/S3fsConfigValidationTest.php, line 29

Class

S3fsConfigValidationTest
S3fs form validation tests.

Namespace

Drupal\Tests\s3fs\Functional

Code

public function testReadOnlySetting() {
  $s3Config = $this->s3Config;
  $s3CustomConfig = $this->s3Config;
  $this
    ->assertEmpty($this->s3fs
    ->validate($s3Config));

  // Read only on a read/write bucket.
  $s3CustomConfig['read_only'] = TRUE;
  $errors = $this->s3fs
    ->validate($s3CustomConfig);
  $this
    ->assertEquals(t('The provided credentials are not read-only.'), $errors[0]);
}