Skip to content

heimer16/neotest-phpunit

 
 

Repository files navigation

neotest-phpunit

Tests

This plugin provides a PHPUnit adapter for the Neotest framework.

Neotest and PHPUnit

⚠️ This plugin is still in the early stages of development. Please test against your PHPUnit tests ⚠️

📦 Installation

Install the plugin using packer:

use({
  'nvim-neotest/neotest',
  requires = {
    ...,
    'olimorris/neotest-phpunit',
  },
  config = function()
    require('neotest').setup({
      ...,
      adapters = {
        require('neotest-phpunit'),
      }
    })
  end
})

🔧 Configuration

The plugin may be configured as below:

adapters = {
  require('neotest-phpunit')({
    phpunit_cmd = function()
      return "vendor/bin/phpunit"
    end
  }),
}

🚀 Usage

Test single method

To test a single test, hover over the test and run lua require('neotest').run.run()

Test file

To test a file run lua require('neotest').run.run(vim.fn.expand('%'))

Test directory

To test a directory run lua require('neotest').run.run("path/to/directory")

Test suite

To test the full test suite run lua require('neotest').run.run({ suite = true })

🎁 Contributing

This project is maintained by the Neovim PHP community. Please raise a PR if you are interested in adding new functionality or fixing any bugs. When submitting a bug, please include an example test that we can test against.

To trigger the tests for the adapter, run:

./scripts/test

👏 Thanks

A special thanks to the following contributers:

About

Neotest adapter for PHPUnit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 84.3%
  • PHP 13.2%
  • Shell 2.2%
  • Vim Script 0.3%