I have a question regarding the installation and configuration of Composer (Phpunit)

Asked

Viewed 54 times

2

I’m doing a project at the Federal Institute of Triângulo Mineiro, on a student control system made in php, so I’m starting a testing phase using Phpunit and I have my doubts because I’m not experienced with this tool. I’m not being able to install and configure Composer to run these tests, would anyone give me a hint? The System is on github. follows the link > https://github.com/Leonardo-Souza/aanc

Note: I already installed and configured Phpunit the problem is only in this part of Composer.

If anyone has a tip that facilitates this installation and configuration I thank you already.

1 answer

1

All you need is to create a file called composer.json in the root folder of your project. The contents of the file will be as follows:

{
    "require-dev": {
        "phpunit/phpunit": "dev-master"
    }
}

(PS: This means the latest version of the dependency phpunit/phpunit will be installed when we install the project development dependencies).

Then, with Composer already installed, run:

composer install

When the command is finished, Phpunit will be installed in the folder vendor/phpunit. To run it, simply run:

vendor/bin/phpunit
  • thanks, the problem has been solved ! D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.