HM\BackUpWordPress\Test_Backup_Path::testIsPathProtected PHP Method

testIsPathProtected() public method

Test that the backup path is correctly protected
public testIsPathProtected ( )
    public function testIsPathProtected()
    {
        // Fake that we're on Apache so we can also test .htaccess
        global $is_apache;
        $is_apache = true;
        // Test the default backup path
        $this->assertFileExists(Path::get_path() . '/index.html');
        $this->assertFileExists(Path::get_path() . '/.htaccess');
        // Test a custom backup path
        $this->path->set_path($this->custom_path);
        $this->path->calculate_path();
        $this->assertFileExists(Path::get_path() . '/index.html');
        $this->assertFileExists(Path::get_path() . '/.htaccess');
    }