You are here

public function FileSecurityTest::testWriteWebConfig in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php \Drupal\Tests\Component\FileSecurity\FileSecurityTest::testWriteWebConfig()
  2. 10 core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php \Drupal\Tests\Component\FileSecurity\FileSecurityTest::testWriteWebConfig()

@covers ::writeWebConfig

File

core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php, line 67

Class

FileSecurityTest
Tests the file security component.

Namespace

Drupal\Tests\Component\FileSecurity

Code

public function testWriteWebConfig() {
  vfsStream::setup('root');
  $this
    ->assertTrue(FileSecurity::writeWebConfig(vfsStream::url('root')));
  $web_config_file = vfsStream::url('root') . '/web.config';
  $this
    ->assertFileExists($web_config_file);
  $this
    ->assertEquals('0444', substr(sprintf('%o', fileperms($web_config_file)), -4));
}