Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Apr 28, 2024
2 parents bb51641 + 5799a4e commit cfca8c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lua/neotest-phpunit/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ end
---@param file_path string Absolute file path
---@return neotest.Tree | nil
function NeotestAdapter.discover_positions(path)
if not NeotestAdapter.is_test_file(path) then
return nil
end

local query = [[
((class_declaration
name: (name) @namespace.name (#match? @namespace.name "Test")
Expand Down
3 changes: 2 additions & 1 deletion lua/neotest-phpunit/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ local function make_outputs(test, output_file)
local test_id = test_attr.file .. separator .. test_attr.line
logger.info("PHPUnit id:", { test_id })

local classname = test_attr.classname or test_attr.class
local test_output = {
status = "passed",
short = string.upper(test_attr.classname) .. "\n-> " .. "PASSED" .. " - " .. test_attr.name,
short = string.upper(classname) .. "\n-> " .. "PASSED" .. " - " .. test_attr.name,
output_file = output_file,
}

Expand Down

0 comments on commit cfca8c4

Please sign in to comment.