function FileSecurityTest::testWriteWebConfigForceOverwrite
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php \Drupal\Tests\Component\FileSecurity\FileSecurityTest::testWriteWebConfigForceOverwrite()
- 10 core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php \Drupal\Tests\Component\FileSecurity\FileSecurityTest::testWriteWebConfigForceOverwrite()
@covers ::writeWebConfig
File
-
core/
tests/ Drupal/ Tests/ Component/ FileSecurity/ FileSecurityTest.php, line 78
Class
- FileSecurityTest
- Tests the file security component.
Namespace
Drupal\Tests\Component\FileSecurityCode
public function testWriteWebConfigForceOverwrite() {
vfsStream::setup('root');
$web_config_file = vfsStream::url('root') . '/web.config';
file_put_contents($web_config_file, "foo");
$this->assertTrue(FileSecurity::writeWebConfig(vfsStream::url('root'), TRUE));
$this->assertFileExists($web_config_file);
$this->assertEquals('0444', substr(sprintf('%o', fileperms($web_config_file)), -4));
$this->assertStringNotContainsString("foo", $web_config_file);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.