HM\BackUpWordPress\Test_Backup_Path::test_cleanup PHP Метод

test_cleanup() публичный Метод

public test_cleanup ( )
    public function test_cleanup()
    {
        // Should be cleaned up
        file_put_contents(PATH::get_path() . '/foo.zip.SmuhtP', 'bar');
        file_put_contents(PATH::get_path() . '/foo.sql', 'bar');
        file_put_contents(PATH::get_path() . '/zicBotXQ', 'baz');
        // Existing backups shouldn't be cleaned up
        file_put_contents(PATH::get_path() . '/backup.zip', 'baz');
        Path::get_instance()->cleanup();
        $this->assertFileNotExists(PATH::get_path() . '/foo.zip.SmuhtP');
        $this->assertFileNotExists(PATH::get_path() . '/foo.sql');
        $this->assertFileNotExists(PATH::get_path() . '/zicBotXQ');
        $this->assertFileExists(PATH::get_path() . '/index.html');
        $this->assertFileExists(PATH::get_path() . '/backup.zip');
    }