function FileSecurityTest::testWriteWebConfig

Same name 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));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.