Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 38... Línea 38...
38
 * @subpackage backup-convert
38
 * @subpackage backup-convert
39
 * @category   test
39
 * @category   test
40
 * @copyright  2011 Mark Nielsen <mark@moodlerooms.com>
40
 * @copyright  2011 Mark Nielsen <mark@moodlerooms.com>
41
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
42
 */
42
 */
43
class moodle1_converter_test extends \advanced_testcase {
43
final class moodle1_converter_test extends \advanced_testcase {
Línea 44... Línea 44...
44
 
44
 
45
    /** @var string the name of the directory containing the unpacked Moodle 1.9 backup */
45
    /** @var string the name of the directory containing the unpacked Moodle 1.9 backup */
Línea 46... Línea 46...
46
    protected $tempdir;
46
    protected $tempdir;
Línea 51... Línea 51...
51
    /** @var string saved hash of an icon file used during testing */
51
    /** @var string saved hash of an icon file used during testing */
52
    protected $iconhash;
52
    protected $iconhash;
Línea 53... Línea 53...
53
 
53
 
54
    protected function setUp(): void {
54
    protected function setUp(): void {
-
 
55
        global $CFG;
Línea 55... Línea 56...
55
        global $CFG;
56
        parent::setUp();
56
 
57
 
57
        $this->tempdir = convert_helper::generate_id('unittest');
58
        $this->tempdir = convert_helper::generate_id('unittest');
58
        $this->tempdirpath = make_backup_temp_directory($this->tempdir);
59
        $this->tempdirpath = make_backup_temp_directory($this->tempdir);
Línea 88... Línea 89...
88
    protected function tearDown(): void {
89
    protected function tearDown(): void {
89
        global $CFG;
90
        global $CFG;
90
        if (empty($CFG->keeptempdirectoriesonbackup)) {
91
        if (empty($CFG->keeptempdirectoriesonbackup)) {
91
            fulldelete($this->tempdirpath);
92
            fulldelete($this->tempdirpath);
92
        }
93
        }
-
 
94
        parent::tearDown();
93
    }
95
    }
Línea 94... Línea 96...
94
 
96
 
95
    public function test_detect_format(): void {
97
    public function test_detect_format(): void {
96
        $detected = moodle1_converter::detect_format($this->tempdir);
98
        $detected = moodle1_converter::detect_format($this->tempdir);