Skip to content

Commit d985c02

Browse files
committed
Update tests
1 parent f59ee3e commit d985c02

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

includes/Traits/Amend_Check_Result.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ trait Amend_Check_Result {
3434
* @param int $severity Severity level. Default is 5.
3535
*/
3636
protected function add_result_message_for_file( Check_Result $result, $error, $message, $code, $file, $line = 0, $column = 0, string $docs = '', $severity = 5 ) {
37+
$filename = explode( $result->plugin()->path(), $file );
3738

3839
$result->add_message(
3940
(bool) $error,
4041
$message,
4142
array(
4243
'code' => $code,
43-
'file' => str_replace( $result->plugin()->path(), '', $file ),
44+
'file' => $filename[1],
4445
'line' => $line,
4546
'column' => $column,
4647
'link' => $this->get_file_editor_url( $result, $file, $line ),

tests/behat/features/plugin-check-severity.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ Feature: Test that the severity level in plugin check works.
6464

6565
When I run the WP-CLI command `plugin check foo-bar-wp --format=csv --fields=code,type,severity`
6666
Then STDOUT should contain:
67+
"""
68+
FILE: foo-bar-wp.php
69+
"""
70+
And STDOUT should contain:
6771
"""
6872
allow_unfiltered_uploads_detected,ERROR,7
6973
"""

0 commit comments

Comments
 (0)