Code Monkey home page Code Monkey logo

vscode-phpunit's Introduction

PHPUnit for VSCode

Run your PHPUnit tests in Node using the Test Explorer UI.

Screenshot

Features

  • Shows a Test Explorer in the Test view in VS Code's sidebar with all detected tests and suites and their state
  • Shows a failed test's log when the test is selected in the explorer
  • Lets you choose test suites or individual tests in the explorer that should be run automatically after each file change

Extension Settings

Include if your extension adds any VS Code settings through the contributes.configuration extension point.

This extension contributes the following settings:

  • phpunit.php: Absolute path to php. Fallback to global php if it exists on the command line.
  • phpunit.phpunit: Path to phpunit. Can be the phpunit file or phpunit.phar.\n\nAutomatically finds it in common places:\n - Composer vendor directory\n - phpunit.phar in your project\n - phpunit (or phpunit.bat for windows) globally on the command line
  • phpunit.command: Custom command to run. Ex: docker exec -t container_name.
  • phpunit.args: Any phpunit args (phpunit --help) E.g. --configuration ./phpunit.xml.dist
  • phpunit.clearOutputOnRun: True will clear the output when we run a new test. False will leave the output after every test.
  • phpunit.showAfterExecution Specify if the test report will automatically be shown after execution

Commands

The following commands are available in VS Code's command palette, use the ID to add them to your keyboard shortcuts:

  • phpunit.reload: PHPUnit: Reload tests
  • phpunit.run-all: PHPUnit: Run all tests
  • phpunit.run-file: PHPUnit: Run tests in current file
  • phpunit.run-test-at-cursor: PHPUnit: Run the test at the current cursor position
  • phpunit.rerun: PHPUnit: Repeat the last test run

Configuration

{
  "phpunit.php": "php",
  "phpunit.phpunit": "vendor/bin/paratest",
  "phpunit.args": [
    "-c",
    "phpunit.xml"
  ],
  "phpunit.paths": {
    // ${pwd} (current directory) is mounted to /app
    "${workspaceFolder}": "/app",
    // ${workspaceFolder} is mapped to /app
  },
}

Docker

{
  "phpunit.command": "docker exec -t [container_id] /bin/sh -c",
  "phpunit.php": "php",
  "phpunit.phpunit": "vendor/bin/phpunit",
  "phpunit.args": [
    "-c",
    "phpunit.xml"
  ],
  "phpunit.paths": {
    // ${pwd} (current directory) is mounted to /app
    "${workspaceFolder}": "/app",
    // ${workspaceFolder} is mapped to /app
  },
}
{
  "phpunit.command": "docker run --rm -t -v ${pwd}:/app -w /app php:latest php",
  "phpunit.php": "php",
  "phpunit.phpunit": "vendor/bin/phpunit",
  "phpunit.args": [
    "-c",
    "phpunit.xml"
  ],
  "phpunit.paths": {
    // ${pwd} (current directory) is mounted to /app
    "${workspaceFolder}": "/app",
    // ${workspaceFolder} is mapped to /app
  },
}

SSH

{
  "phpunit.command": "ssh -i dockerfiles/sshd/id_rsa -p 2222 root@localhost -o StrictHostKeyChecking=no",
  "phpunit.php": "php",
  "phpunit.phpunit": "/app/vendor/bin/phpunit",
  "phpunit.args": [
    "-c",
    "/app/phpunit.xml"
  ],
  "phpunit.paths": {
    // ${pwd} (current directory) is mounted to /app
    "${workspaceFolder}": "/app",
    // ${workspaceFolder} is mapped to /app
  }
}

Troubleshooting

vscode-phpunit's People

Contributors

andreiormanji avatar recca0120 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-phpunit's Issues

Doesn't recognise failures from data providers

When @dataProvider is used to run the same test over multiple data sets, the test will appear to have passed in the Code Lens and the Test Explorer as long as any one of the data sets passes the test, even though the output window shows failures and errors on the other data sets.

Running single test sometimes causes full test suite to run

I haven't been able to track down a specific cause of this.

Occasionally when I'm in a test file and click the "run" button that the extension includes above the test it will run the full test suite rather than the individual test.

Sometimes clicking it doesn't appear to do anything and I have to click it multiple times and I think this is when it's trying to run the full test suite.

I know I don't have many details in this issue but just wondering if other people are experiencing it so we can maybe find some common info?

Include parameters

Include parameters, example coverage-clover
this is useful for the coverage report
Captura de pantalla de 2019-07-06 22-25-21

Tests not executing

Hi there,

i can't run tests with this extension. All tests will fail and i get the following output in PHPUnit LanguageServer window:

@echo OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../phpunit/phpunit/phpunit
php "%BIN_TARGET%" %*

I use Windows 10 and the general PHP and PHPUnit setup works.

Can you help?

Best regards Chris

test explorer don't work

Hello,
my test explorer doesn't works :( , i've tested uninstal, delete .vscode folder and reinstall but no success . Could you help me please
image

Test Explorer doesn't show all tests in suite.

I have a test suite that uses inheritance, so I have an abstract base class (TestSetup) that extends TestCase, then I have another abstract class that implements the actual test methods (let's call it TestsImpl) and extends TestSetup, then I have concrete classes that each provides a different configuration to TestImpl.

So you can think of the hierarchy as TestImplConfA > *TestImpl > *TestSetup > TestCase

While PHPUnit runs all these tests, the test explorer doesn't show them.

The test methods are marked with @test comment attribute.

Tests won't run

Tests are running just fine using the PHPUnit command line but I got those odd warnings with the VSC extension :

image

Tests are showing as "Success" even if failed

The tests are shown as "Success" even some of them get failed at the tests.

image

OS: Ubuntu 19-04 and Windows 10

Here are my phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true"
         backupStaticAttributes="true"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="true"
         stopOnError="true"
         stopOnFailure="true"
         verbose="true">
    <testsuites>
        <testsuite name="Package Test Suite">
            <directory suffix="Test.php">./tests</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src</directory>
        </whitelist>
    </filter>
    <logging>
        <log type="coverage-clover" target="./build/coverage.xml"/>
        <log type="json" target="./build/coverage.json"/>
        <log type="junit" target="./build/coverage-junit.xml"/>
    </logging>
</phpunit>

Here are my Composer.json

{
  "autoload": {
    "classmap": [
      "src/"
    ]
  },
  "require-dev": {
    "phpunit/phpunit": "8.1.2"
  },
}

Single test won't run on windows

Hello,

The runner works fine on classes or whole project, however when I want to run a single test on windows I get the following:

unrecognized option --configuration ./app/tests/phpunit.xml --filter .*::(testMethod)(

It works fine on linux.

Is there a verbose option, so that I can see the exact command the runner spins?
I don't understand the extract ( at the end of the filter - which should not be there, but even that should not give us 'unrecognized option'.

If I run the test manually it works fine:

phpunit.bat  --configuration ./app/tests/phpunit.xml --filter .*::(testGetPois)

Unable to reload tests : UnhandledPromiseRejectionWarning: Error: Unhandled method TestLoadStartedEven

Hello,

The list of the tests is correctly updated when reloading VS Code. All the tests run without any error.

But when I click on "reload tests" button (or using the related command), I have an error in the output console.

Has anyone come across this problem before ?

Thank you!

NB: I'm not allowed (yet) to upgrade PHP version, for dev servers are still under PHP 7.0.x.

console error at the end of first test run (not always the first, but very often)

events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: EISDIR: illegal operation on a directory, read
Emitted 'error' event at:
    at lazyFs.read (internal/fs/streams.js:165:12)
    at FSReqWrap.wrapper [as oncomplete] (fs.js:460:17)
[Info  - 17:16:32] Connection to server got closed. Server will restart.

then, console error when cliking on reload button or any run button

(node:11312) UnhandledPromiseRejectionWarning: Error: Unhandled method TestLoadStartedEvent-3921af80150269569a39383d0af40851
    at c:\Users\Greg\.vscode\extensions\recca0120.vscode-phpunit-2.0.72\server\out\server.js:1:9288
    at c:\Users\Greg\.vscode\extensions\recca0120.vscode-phpunit-2.0.72\server\out\server.js:1:9582
    at Immediate.G.C.size.setImmediate (c:\Users\Greg\.vscode\extensions\recca0120.vscode-phpunit-2.0.72\server\out\server.js:1:9943)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
(node:11312) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

settings.json

{
...
  "phpunit.args": [
    "--configuration",
    "C:/myproject/phpunit-fast.xml",
  ],
  "phpunit.files": "{front,backend}/unit_tests/**/*Test.php",
...
}

composer.json

{
...
	"require-dev" : {
		"mockery/mockery" : "0.9.9",
		"phpunit/php-code-coverage" : "^5.3",
		"phpunit/php-file-iterator" : "1.4.5",
		"phpunit/php-text-template" : "1.2.1",
		"phpunit/php-timer" : "^1.0.9",
		"phpunit/php-token-stream" : "^2.0.1",
		"phpunit/phpunit" : "^6.5.13",
		"phpunit/phpunit-mock-objects" : "^5.0.9",
		"sebastian/environment": "^3.0",
		"sebastian/version": "^2.0.1",
		"sebastian/comparator": "^2.0.2",
		"sebastian/diff": "^2.0",
		"sebastian/exporter": "^3.1",
		"sebastian/global-state": "^2.0",
		"sebastian/recursion-context": "^3.0"
	},
...
}

node -v

v10.16.0

php -v in terminal

PHP 7.0.33 (cli) (built: Dec  5 2018 21:22:29) ( ZTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

wamp

WampServer Version 3.1.9 64bit
Created by Romain Bourdon (2005)
Maintainer / Upgrade to 2.5 by Herve Leclerc
Upgrade to 3 by Otomatic ([email protected])
Multi styles for homepage by Jojaba
Installer by Inno Setup: http://www.jrsoftware.org/isinfo.php
Forum Wampserver: http://forum.wampserver.com/index.php
______________________ Versions used ______________________
Apache 2.4.39 Port 80- PHP 7.0.33
PHP 5.6.31 for CLI (Command-Line Interface)

image

compability problems

I use the composer package kenjis/ci-phpunit-test. I can only run tests from a specific test directory. I need to configure the path where phpunit is executed.

Thank you very much and willing to help

Hello,

First off, thank you very much for this extension. I have used it and it works very good. Hats off :)

Now I see some of the features aren't being implemented and I would like to lend a hand. If you have some sort of roadmap or contribution guide, do let me know 👍

Cannot read property 'file' of undefined

My problem probably is that this extension cannot find the PHPUnit binary (my tests live in a subfolder of a workspace, so the vendor folder is not at the top level) but the error given is rather mysterious:

(node:25214) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'file' of undefined
    at e.Controller.<anonymous> (/Users/borekb/.vscode/extensions/recca0120.vscode-phpunit-2.0.41/server/out/server.js:1:76244)
    at Generator.next (<anonymous>)
    at /Users/borekb/.vscode/extensions/recca0120.vscode-phpunit-2.0.41/server/out/server.js:1:74403
    at new Promise (<anonymous>)
    at s (/Users/borekb/.vscode/extensions/recca0120.vscode-phpunit-2.0.41/server/out/server.js:1:74180)
    at e.Controller.runFile (/Users/borekb/.vscode/extensions/recca0120.vscode-phpunit-2.0.41/server/out/server.js:1:76116)
    at e.Controller.<anonymous> (/Users/borekb/.vscode/extensions/recca0120.vscode-phpunit-2.0.41/server/out/server.js:1:75847)
    at Generator.next (<anonymous>)
    at /Users/borekb/.vscode/extensions/recca0120.vscode-phpunit-2.0.41/server/out/server.js:1:74403
    at new Promise (<anonymous>)
(node:25214) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)

I've also seen a similar error with EACCES which I cannot reproduce now.

It would be nice if a more useful message was printed.

Unable to load custom config file

I have the following configuration:

"phpunit.execPath": "D:\\webdev\\www\\project\\app\\vendor\\bin\\phpunit.bat",
    "phpunit.args": [
        "-c D:\\webdev\\www\\project\\app\\vendor\\bin\\phpunit.xml"
    ]

It does however not seem to load the bootloader which is configured as such:

bootstrap="D:\\webdev\\www\\compufact\\app\\core\\bootstrap.php"

I also tried with quotes and a few other things. Am I doing something wrong?

Thanks

Using relative path

Hello !
I can't find any way to set a relative path for phpunit.
I am using Symfony, and I don't want to update setting.json every single time I start a new project, nore add a local .vscode/settings.json file.
Isn't it possible to use a variable like ${workspaceFolder} to find bin/phpunit in everyworkspace ?

Failed tests remains in problems and editor after fixing

Hello,

I have encountered a bug I believe. Say I have a test failing. If I run it, it shows up as Decoration, in the PROBLEMS (panel) and also as wiggly underline.

Now if I start changing the file, the Decoration goes away. Once I have fixed the test and run it again, the cross mark on the gutter turns to green check. But the PROBLEMS panel and the wiggly underline stays.

Do let me know if I am able to explain the issue, otherwise I will post a screenshot or video.

Duplicating a test file breaks the test

Steps to reproduce:

  1. Create a test file e.g. MyTest.php with a class MyTest
  2. Copy this test file in an attempt to quickly create a new test without writing from scratch, resulting in a MyTest.1.php file
  3. Rename this MyTest.1.php file to the desired new test name e.g. NewTest.php and rename the class accordingly

Now the test explorer shows two tests called "MyTest", and both never go away and cannot be run. The following error occurs in the output for both "MyTest" tests (the original test filename is overridden by the temporary copy):

Cannot open file "...\MyTest.1.php"

The only way to fix this is to close the workspace and re-open it. The NewTest test however works fine.

Missing explanation how to set phpunit path

Hello,

I tried to install your extension but I have no idea how to make it run?
It is installed without errors and also without output. I am having a composer package where phpunit is installed. In my case it is not the vendor Directory. It is .\bin\phpunit because it is Flow Framework Project and I have this path to the phpunit configuration file: .\Build\BuildEssentials\PhpUnit\UnitTests.xml
Here is the command I use to run it in the powershell:

C:\Path\To\Workspace\Project> .\bin\phpunit -c .\Build\BuildEssentials\PhpUnit\UnitTests.xml .\Packages\Application\ --colors=always`

So my question is: How can I set the path to phpunit executable and how can i run your extension?

Thanks,

Markus

extension ignores phpunit configuration

I have this in my vscode settings:

phpunit.args = [
    "--configuration tests/phpunit.xml"
];

The XML file doesn't get read (therefore, doesn't bootstrap and the test won't run properly), no matter what I put in that setting, be it relative to the executable or the workspace, or an absolute path. The only way to make it work is to have the file phpunit.xml in the workspace root.

It also seems to ignore the phpunit.php and phpunit.phpunit settings (executable locations) and just run whatever it wants.
This started when the extension auto-upgraded to 2.0, I'm now running 2.0.40 and vscode 1.34.

PHPUnit Running notification doesn't dismiss

Hello. Thanks for your excellent package.

I have autorun on for tests. I get a notification when the tests start running. However, the notification doesn't auto dismiss, sometimes the notifications will stack up to 3 notifications all un dismissable ( without lots of clicking ) It appears after the tests have run the notifications stack up.

With auto run and autosave enabled, I quickly get a barrage of notifications.

Screenshot 2020-03-19 at 07 49 20

Is there an issue here? Also Is there a way to stop notifications? I don't really need them.

Access file code from right click menu

I feel kind of silly thowing a question like that, I guess it would have a reason not to, for it seams to be to be a pretty basic function but ... would'nt it be nice to have some kind of "Open File" or "Reveal on sidebar" option when you right click a test on the Test Explorer?

By what I understand the Test Explorer is part of the Test Explorer UI and therefor it would have some options where the file been used is not sourcecode, but when talking about PHP I guess we can count about 99,99% os the files would be simple sourcecode.

Autorun not triggering.

I'm very new to writing tests and using phpunit, but so far your extension helped me a lot. The inly thing I'm not getting to work is the autorun feature.

I can enable autorun, and the tiny 'play triangle' gets added to the test icons. But when I change and save any file. None of the tests are automatically triggered.

Am I forgetting anything? Thanks!

Shortcut not working

When I try to use ⌘T ⌘T to run 'PHPUnit: Run the test at the current cursor position'
it can't work.

But if I try F1 and choose it, it works.

Did I miss something?

Colors

Thanks for the plugin, it's very useful.

I think there was an update that happened this morning, and now I am not seeing any colours. Previously I used to get a red or green block in the gutter, the filename and the output.

VSCode Version: 1.33.1
PHPUnit Version: 7.5.8
vscode-phpunit Version: 2.0.4
Screenshot 2019-05-03 at 09 29 14

phpunit.php and phpunit.phpunit doesn't fallback to default values

Hello,

I'm trying to use vscode 1.40.1 (windows 10 x64) with PHPUnit Test Explorer extension (2.0.72), but can't get it to work without setting phpunit.php and phpunit.phpunit settings as package.json states:

"phpunit.php": {
	"type": "string",
	"description": "Absolute path to php. Fallback to global php if it exists on the command line."
},
"phpunit.phpunit": {
	"type": "string",
	"description": "Path to phpunit. Can be the phpunit file or phpunit.phar.\n\nAutomatically finds it in common places:\n  - Composer vendor directory\n  - phpunit.phar in your project\n  - phpunit (or phpunit.bat for windows) globally on the command line"
},

I have php executable in environment path and phpunit installed in vendor/phpunit/phpunit, but only result I get is:
spawn -c ENOENT

When I set BOTH of these settings to absolute paths, everything is working OK, but that is not what I wanted to achieve.

Is there any way to get it sorted out?

Customize Test Explorer title / label

It would be nice if this extension customized the test explorer title (if that's possible) – I have more extensions that use the panel and it's currently hard to know which is which:

Screenshot 2019-05-22 at 16 36 47

Seeing "PHPUnit Tests" or similar would be great.

UnhandledPromiseRejectionWarning: Error: spawn UNKNOWN

setting.json

{
    "phpunit.phpunit": "${workspaceFolder}/phpunit.phar",
    "phpunit.args": [
        "--configuration ${workspaceFolder}/phpunit.xml"
    ],
}

版本資訊

PHP: 7.2.9
PHPUnit 版本: 8.1.5
PHPUnit 位置: workspace 根目錄 (phpunit.phar)
phpunit.xml 位置: workspace 根目錄

image

完整訊息

(node:12924) UnhandledPromiseRejectionWarning: Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:357:11)
    at Object.spawn (child_process.js:540:9)
    at Promise (c:\Users\terry\.vscode\extensions\recca0120.vscode-phpunit-2.0.50\server\out\server.js:6:123901)
    at new Promise (<anonymous>)
    at e.Process.run (c:\Users\terry\.vscode\extensions\recca0120.vscode-phpunit-2.0.50\server\out\server.js:6:123813)
    at e.TestRunner.<anonymous> (c:\Users\terry\.vscode\extensions\recca0120.vscode-phpunit-2.0.50\server\out\server.js:6:122800)
    at Generator.next (<anonymous>)
    at o (c:\Users\terry\.vscode\extensions\recca0120.vscode-phpunit-2.0.50\server\out\server.js:6:121482)
(node:12924) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 30)

命令列執行正常,透過插件不行。

謝謝開發如此美觀好用的插件,可惜目前遇到此問題
尚未使用。如果能解決,那真的很感謝。

Feature request: Go to test from context menu in test explorer

I'm loving this extension. It has worked really well but one thing that I feel is missing is a Go to test from the context menu when you right click on a test in the explorer. There are obvious workarounds, but having a quick way to do this seems like a quick win.

The PHPUnit Language Server server crashed on Linux environment

先感謝 @recca0120 大大寫了這麼好用的套件XDD

我遇到的問題是在安裝套件之後 vscode 會出現以下錯誤訊息

  • Error message from vscode
The PHPUnit Language Server server crashed 5 times in the last 3 minutes.
The server will not be restarted.
  • Error log from PHPUnit Language Server output
Error: Cannot find module './snippets'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
    at Function.Module._load (internal/modules/cjs/loader.js:528:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/jonz94/.vscode/extensions/recca0120.vscode-phpunit-2.0.30/server/out/server.js:12:20)
    at Object.<anonymous> (/home/jonz94/.vscode/extensions/recca0120.vscode-phpunit-2.0.30/server/out/server.js:213:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
[Info  - 1:38:52 AM] Connection to server got closed. Server will restart.
internal/modules/cjs/loader.js:604
    throw err;
    ^

發現到是 ~/.vscode/extensions/recca0120.vscode-phpunit-2.0.30/server/out/server.js 這個檔案裡面的這行出現問題

const snippets_1 = require("./snippets");

因為預期要 require 的 Snippets.js 檔名是大寫開頭的,跑到這行時就炸掉了XDD

PS. 我有在 Windows 和 macOS 的 vscode 也安裝這個套件,都可以正常運作,而且 server.js 的那行一樣是 require("./snippets"),不過在 Windows 和 macOS 上這行好像不會出問題XDD

目前自己暫時的解決方法是手動去修改 server.js 這個檔案

-const snippets_1 = require("./snippets");
+const snippets_1 = require("./Snippets");

不過感覺這不是正規的解法XD,畢竟這個檔案是被 compile 出來的檔案

Test reloading problem

Upon first opening a folder/workspace, all the tests seem to be discovered and shown in the Test Explorer, even if they are not present within phpunit.xml.

image

However, upon editing a file, or clicking the "reload tests" button, all the tests configured in the test suites in phpunit.xml vanish, leaving only the ones that shouldn't have been there in the first place.

image

Perhaps ellipsize test case names with tooltip

Thanks for integrating PHPUnit in a neat test explorer.

This is a report of this ticket, which the maintainer mentioned may be due to the adapter (hence, this package): hbenl/vscode-test-explorer#102

I'll repost the same content for completeness' sake:

The PHP plugin shows the entire FQCN of the test case class, which makes items in the tree very long. This in turn makes it hard to reach the button to navigate to the source - which I didn't even know existed and I wanted to report an issue about it, until I discovered #69.

An example to demonstrate how long the test names are:

Example

Would it be possible to ellipsize long test names (and e.g. show the full name in a tooltip on hover), or ellipsize the first part of the name (as the last part is usually the most important)? The idea is that there would be no horizontal scrollbar and the action buttons would always be visible on hover to the right. This would be similar to what the Tree Style Tabs extension does in Firefox:

Firefox Tree Style Tabs

Thanks!

Cannot run all tests

Running all tests doesn't seem work to work. The test explorer output just shows phpUnit usage:

PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

Usage: phpunit [options] UnitTest [UnitTest.php]
phpunit [options]

Code Coverage Options:
...

The diagnostics log shows it's because PHPUnit is being run with no arguments when it expects at least one:

[2019-10-16 15:13:01.099] [INFO] { title: 'PHPUnit LSP',

command: 'c:\<some path>\vendor\bin\phpunit.bat',
arguments: [] }

Should "Run all tests" instead pass the current dir e.g: c:\<some path>\vendor\bin\phpunit.bat' .?

unable to call parent::setUp() and causes whole test suite break

Laravel version: 5.8
PHP version: 7.2.19
phpunit version: 7.5.17
OS: Windows 10 professional 1809
Node.js version: 12

I got a test file that calls setUp() at the very beginning with calling setUp() in TestCase.
When I run all the tests with this extension, the first error was "ReflectionException: Class env does not exist", making all next tests unfunctional with the same exception.

Missing status bar progress spinner

Hi,

There used to be a small spinner in the status bar when I click on "Run Test" through code lens. But with the latest update it is gone.

Could you please tell me, if this was intended or maybe my vscode is messed up?

Do not auto-detect tests from `vendor`, recursively

After the recent change in #18 which added recursive scanning for tests (I think), I get a lot of tests that are not "mine" but from vendor directories:

Screenshot 2019-05-20 at 09 02 20

I think the solution could be to automatically skip gitignored directories.

(This behavior is without any custom config. It's possible that I will be able to work around this by setting PHPUnit configuration via phpunit.args but I still think that by default, gitignored directories should not be scanned.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.