Install PHPUNIT with Composer

前端 未结 7 1705
面向向阳花
面向向阳花 2021-02-13 02:27

I have project on Symfony 2 and i would like use PHPUNIT on Windows 7.

On githut phpunit is:

Composer

Simply add a dependency on phpunit/phpunit to your proje         


        
7条回答
  •  轮回少年
    2021-02-13 03:22

    composer require --dev phpunit/phpunit ^7
    

    The above example assumes, composer is already on your $PATH variable.

    You composer.json should look similar to;

    {
      "name": "vendor_name/package_name",
      "description": "This project is for practicing writing php unit tests",
      "minimum-stability": "stable",
      "license": "proprietary",
      "authors": [
        {
          "name": "Umair Anwar",
          "email": "umair.anwar@gmail.com"
        }
      ],
      "autoload": {
        "classmap": [
          "src/"
        ]
      },
      "require-dev": {
        "phpunit/phpunit": "^7",
        "phpunit/dbunit": "^4.0"
      }
    }
    

提交回复
热议问题