Jump to content

should phpunit be used with composer?


Go to solution Solved by Jacques1,

Recommended Posts

I've never used unit testing, but am starting to try.

 

https://phpunit.de/getting-started.html describes the primary means as a phar file, but then goes on to say it is possible to use composer.  Should I use one over the other?  Also, any recommendations on a good tutorial?  I am not overly impressed with the official getting started document.

 

Edit1. If it is done with composer, is it restricted to a single directory, or can it be made global?  Edit2.  I guess it could be made global.  Not sure yet how this works, but will look into.

 

Thanks

Edited by NotionCommotion
Link to comment
https://forums.phpfreaks.com/topic/302112-should-phpunit-be-used-with-composer/
Share on other sites

  • Solution

The benefit of using composer is that you get automatic dependency management. If you rely on a phpunit.phar file, you have to manually download it on every system and make sure it's the right version.

 

To get started, you can read existing tests of (simple) GitHub projects. If you don't like the PHP-specific resources, you can also switch to Java unit tests which work very similar.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.