Skip to content

Commit

Permalink
fix(TestRuns): return correct test run data
Browse files Browse the repository at this point in the history
  • Loading branch information
domtra committed Oct 9, 2024
1 parent 3451dc4 commit 04b4e9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/models/class-test-run.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ public static function get_trigger_title( $test_run ) {
'scheduled' => __( 'Schedule', 'visual-regression-tests' ),
'api' => __( 'API', 'visual-regression-tests' ),
'update' => __( 'Update', 'visual-regression-tests' ),
'legacy' => __( 'Legacy', 'visual-regression-tests' ),
];

return $trigger_titles[ $test_run->trigger ] ?? __( 'Unknown', 'visual-regression-tests' );
Expand Down Expand Up @@ -542,6 +543,6 @@ public static function get_next_scheduled_run() {
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- It's ok.
"SELECT * FROM $test_runs_table WHERE finished_at IS NULL AND scheduled_at IS NOT NULL ORDER BY scheduled_at ASC LIMIT 1",
);
return empty( $test_run ) ? null : static::cast_values( $test_run );
return $test_run;
}
}

0 comments on commit 04b4e9f

Please sign in to comment.