diff --git a/tests/unit-tests/log/log-handler-file.php b/tests/unit-tests/log/log-handler-file.php index 73972188c1a..5e64a2aafc0 100644 --- a/tests/unit-tests/log/log-handler-file.php +++ b/tests/unit-tests/log/log-handler-file.php @@ -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' ) ); } } diff --git a/tests/unit-tests/util/class-wc-tests-core-functions.php b/tests/unit-tests/util/class-wc-tests-core-functions.php index 94e84516696..5c7a9602cf9 100644 --- a/tests/unit-tests/util/class-wc-tests-core-functions.php +++ b/tests/unit-tests/util/class-wc-tests-core-functions.php @@ -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' ) ); } /**