Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

Debugging unit tests? #6

Description

@rulatir

Here are the relevant parts of my workspace configuration:

    "yet-phpunit.docker.enable": true,
    "yet-phpunit.docker.command": "docker-compose -f /home/rulatir/works/webzuu/zuu/docker/docker-compose-dev.yml --project-directory=/home/rulatir/works/webzuu/zuu exec php /usr/bin/env XDEBUG_CONFIG=\"remote_host=172.17.0.1\",
    "yet-phpunit.phpunitBinary": "/apps/cms/vendor/bin/phpunit",
    "yet-phpunit.xmlConfigFilepath": "/apps/cms/phpunit.xml",
    "yet-phpunit.codelens": true,
    "yet-phpunit.docker.paths": {
        "/home/rulatir/works/webzuu/zuu/apps/cms": "/apps/cms"
    },

As you can see, the docker command uses env to pass XDEBUG_CONFIG to phpunit. It works. I can set a breakpoint in a test method, hit the codelens, and it stops on the breakpoint. But I would like to be able to define a separate "run configuration" for debugging tests, and there doesn't seem to be a way to do this.

I want to be able to:

  • debug my tests with Xdebug extension loaded and the right env vars passed,
  • run my tests normally with an alternate no-xdebug php.ini,
  • without having to edit the configuration every time I want to switch between the above two modes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions