Update unit tests

This commit is contained in:
claudiulodro 2018-05-01 09:32:29 -07:00
parent d85dd36195
commit 9c1179856d
2 changed files with 4 additions and 2 deletions

View File

@ -197,8 +197,9 @@ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case {
*/
public function test_get_log_file_path() {
$log_dir = trailingslashit( WC_LOG_DIR );
$date_suffix = date( 'Y-m-d', current_time( 'timestamp', true ) );
$hash_name = sanitize_file_name( wp_hash( 'unit-tests' ) );
$this->assertEquals( $log_dir . 'unit-tests-' . $hash_name . '.log', WC_Log_Handler_File::get_log_file_path( 'unit-tests' ) );
$this->assertEquals( $log_dir . 'unit-tests-' . $date_suffix . '-' . $hash_name . '.log', WC_Log_Handler_File::get_log_file_path( 'unit-tests' ) );
}
}

View File

@ -239,8 +239,9 @@ class WC_Tests_Core_Functions extends WC_Unit_Test_Case {
public function test_wc_get_log_file_path() {
$log_dir = trailingslashit( WC_LOG_DIR );
$hash_name = sanitize_file_name( wp_hash( 'unit-tests' ) );
$date_suffix = date( 'Y-m-d', current_time( 'timestamp', true ) );
$this->assertEquals( $log_dir . 'unit-tests-' . $hash_name . '.log', wc_get_log_file_path( 'unit-tests' ) );
$this->assertEquals( $log_dir . 'unit-tests-' . $date_suffix . '-' . $hash_name . '.log', wc_get_log_file_path( 'unit-tests' ) );
}
/**