mirror of
https://gh.wpcy.net/https://github.com/aspirepress/aspireupdate.git
synced 2026-07-17 09:56:36 +08:00
31 lines
750 B
PHP
31 lines
750 B
PHP
<?php
|
|
/**
|
|
* Abstract base test class for \AspireUpdate\Filesystem_Direct.
|
|
*
|
|
* All \AspireUpdate\Filesystem_Direct unit tests should inherit from this class.
|
|
*/
|
|
abstract class FilesystemDirect_UnitTestCase extends WP_UnitTestCase {
|
|
protected static $test_file = '/tmp/aspireupdate-test-file.txt';
|
|
|
|
/**
|
|
* Remove the test file should it exist before any tests run.
|
|
*/
|
|
public static function set_up_before_class() {
|
|
parent::set_up_before_class();
|
|
|
|
if ( file_exists( self::$test_file ) ) {
|
|
unlink( self::$test_file );
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Remove the test file should it exist after each test runs.
|
|
*/
|
|
public function tear_down() {
|
|
if ( file_exists( self::$test_file ) ) {
|
|
unlink( self::$test_file );
|
|
}
|
|
|
|
parent::tear_down();
|
|
}
|
|
}
|