Open the composer.json file and add the following lines. Inside this folder we are going to keep all the application code. Now inside the project folder we will create an app folder. So, run the following command in the terminal to create a test folder. Now inside our project folder we will go ahead and create a test folder. If you are able to get the above line which says the version and author of PHPUnit then it is installed. There will be more lines printed in the terminal. PHPUnit 5.7.19 by Sebastian Bergmann and contributors. Open terminal and run the following command to check if phpunit is running properly. Phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)Īfter installing composer our project folder will look like the following. Sebastian/global-state suggests installing ext-uopz (*) Symfony/yaml suggests installing symfony/console (For validating YAML files using the lint command) Installing phpunit/phpunit (5.7.19) Downloading: 100% Installing myclabs/deep-copy (1.6.1) Downloading: 100% Installing phpspec/prophecy (v1.7.0) Loading from cache Installing phpdocumentor/reflection-docblock (3.1.1) Loading from cache Installing phpdocumentor/type-resolver (0.2.1) Loading from cache Installing phpdocumentor/reflection-common (1.0) Loading from cache Installing webmozart/assert (1.2.0) Loading from cache Installing phpunit/php-code-coverage (4.0.8) Downloading: 100% Installing phpunit/php-token-stream (1.4.11) Loading from cache Installing sebastian/code-unit-reverse-lookup (1.0.1) Loading from cache Installing phpunit/php-file-iterator (1.4.2) Loading from cache Installing phpunit/php-timer (1.0.9) Loading from cache Installing phpunit/phpunit-mock-objects (3.4.3) Loading from cache Installing phpunit/php-text-template (1.2.1) Loading from cache Installing doctrine/instantiator (1.0.5) Loading from cache Installing sebastian/comparator (1.2.4) Loading from cache Installing sebastian/diff (1.4.1) Loading from cache Installing sebastian/environment (2.0.0) Loading from cache Installing sebastian/exporter (2.0.0) Loading from cache Installing sebastian/global-state (1.1.1) Loading from cache Installing sebastian/object-enumerator (2.0.1) Loading from cache Installing sebastian/recursion-context (2.0.0) Loading from cache Installing sebastian/resource-operations (1.0.0) Loading from cache Installing sebastian/version (2.0.1) Loading from cache Installing symfony/yaml (v3.2.7) Downloading: 100% Package operations: 25 installs, 0 updates, 0 removals Updating dependencies (including require-dev) Loading composer repositories with package information YUSUF-MacBook-Pro:phpunit yusufshakeel$ composer require phpunit/phpunit Use the following command in terminal to get phpunit in your project. Now move inside this project folder and require phpunit using composer. Lets begin our journey by first creating a project folder in our localhost and name this as phpunit.
0 Comments
Leave a Reply. |