Skip to content

Instantly share code, notes, and snippets.

@Gonzalo2683
Last active June 12, 2020 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gonzalo2683/6ab6bfb3aee14c0999015ad364c4f0b7 to your computer and use it in GitHub Desktop.
Save Gonzalo2683/6ab6bfb3aee14c0999015ad364c4f0b7 to your computer and use it in GitHub Desktop.
[PhpStorm UnitTest Ddev Docker] PhpUnit con Docker #PhpStorm

Configuration

Test framework

  1. Go to Languages && Frameworks > PHP > Test Frameworks

  2. Click + button and select PhpUnit by Remote Interpreter

  3. Si no tienes alguno de ddev creado, click el en botón con tres puntos "..." y se debe crear uno sobre service web Ddev, caso contrario selecciona el interprete basado en el servicio web de Ddev. click Aceptar

  4. Esto no regresa a la pantalla de configuración anterior(Test Frameworks)

    En PhpUnit library Seleccionamos User composer autoloader

    En test runner Marcamos Default connfiguration file : /opt/project/web/core/phpunit.xml Aca va la ruta al phpunit.xml que hicimos copia del core de Drupal, tener en cuenta que esta ruta empieza con /opt/project que es el volumen que PhpStorm usar para referenciar la raiz del proyecto

    click Aplicar y Aceptar

Runner tool

  1. Ir a Run > Edit configuration

  2. Click in "+" button

  3. Seleccionar PhpUnit

  4. Asignarle un nombre y configurar:

    En Test Runner

    Seleccionar Defined in the configuration file

  5. Aceptar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment