publicFilesDirectory . '/test/private'; // Verify that file_save_htaccess() returns FALSE if .htaccess cannot be // written and writes a correctly formatted message to the error log. Set // $private to TRUE so all possible .htaccess lines are written. $this->assertFalse(file_save_htaccess($private, TRUE)); $this->drupalLogin($this->rootUser); $this->drupalGet('admin/reports/dblog'); $this->clickLink("Security warning: Couldn't write .htaccess file. Pleaseā€¦"); $lines = FileStorage::htaccessLines(TRUE); foreach (array_filter(explode("\n", $lines)) as $line) { $this->assertEscaped($line); } } }