Giter Club home page Giter Club logo

vscode-phpunit-extended's People

Contributors

robertostermann avatar santigarcor avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

slmtbdwry dylf

vscode-phpunit-extended's Issues

More specific "Set the config values:"

"Set the config values:" is not clear enough to know where to put the config values.
Do you put it next to the other parameters in settings.json?

Thanks :)

I would like to clarify that I know I am supposed to put it into my settings.json file.

Skipped tests show up as failed

testdox shows failed tests as red, but "incomplete, skipped or risky tests" as amber.
Test explorer is showing these as red, making them indistinguishable from the failed tests.

Issue with running test inside docker container

docker compose exec {php_container} bin/phpunit /var/www/app/tests/Unit/MyTest.php

spawn docker compose exec php bin/phpunit ENOENT
-------------------------------------------------------

However when I'm enabling Show output to Terminal, the test case is running without problems but the status of the test case in the UI and test explorer still marked as error

Error `Couldn't find a working directory`

Hi, thank you for this cool extension.

I get error every time running the test.

Couldn't find a working directory.

That's all what I get in the terminal output and popup notification.

I install the extension in vscode-server a.k.a via Remote SSH, where the project directory is inside docker that can be accessed with SSH. So I try calling phpunit with SSH command to the docker container (from Remote SSH session workspace).

My config is like this:

                "phpunit.testExplorer.folderPattern": "app/code/Vendor/**/{test,tests,Test,Tests}/**/*.php",
		"phpunit.commandLine.args": [
			"-c",
			"/home/cloudpanel/htdocs/project/dev/tests/unit/phpunit.xml"
		],
		"phpunit.testExplorer.verboseTestExplorerOutput": true,
		"phpunit.execPath": "/usr/bin/ssh -t -t root@localhost \"cd /home/cloudpanel/htdocs/project; /usr/bin/php /home/cloudpanel/htdocs/project/vendor/bin/phpunit\"",
		"phpunit.testExplorer.showOutput": "always"

FR: detect tests via annotation

Thank you for the extension.

I've been looking for a replacement for "recca0120.vscode-phpunit" for a while and came across this one.

I'm havign trouble getting this extension to recognise my tests.
Basically,

  • all my tests files are sub-folders in ./tests
  • all my test files end in Test.php
  • all the test are marked with annotation
<?php

namespace Tests\Unit;

use PHPUnit\Framework\TestCase;

class ExampleTest extends TestCase
{
    /** @test */
    public function this_should_work()
    {
        $this->assertTrue(true);
    }

    /**
     * @test
     * @group error
     */
    public function this_should_not_work()
    {
        $this->assertTrue(false);
    }
}

When I install this extension, I can't see the test icon unless I open a test file. At that point, it populates with every test in my workspace, including vendor.

I think my tests are not displaying because this extension assumes a "functionRegex", and can't detect @test annotations, but I'm not really sure. Regex is a crazy powerful, but I still struggle writing & parsing it.

My current config is the following.

    "phpunit.folderPattern": "./{tests}/**/*Test.php",
    "phpunit.fileRegex": ".*(Test).php",
    "phpunit.functionRegex": "/\\s*(public\\s+){0,1}function\\s+(\\w*test\\w*)\\s*\\(",

What am I doing wrong?

PHPunit Extended with TestExplorter: 0.2.5
Test Explorer: 2.21.1
Test Adapter: 0.1.4
Vscode: 1.62.3
OS: Remote: WSL 0.58.5, Ubuntu via Win10 WSL2

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.