- Composer
- PHPunit
- Collection test
- Better PHPunit (extension)-- it is not very useful to me.
I don't want to gloabally installed phpunit, so I used
vendor/bin/phpunit
or
ctrl
+ shift
+ p
-> Better PHPUnit: Run all tests
Autotest run setting (only for Better PHPunit, shortcut):
shift
+ windows + R
- We don't want to run the configuaration options individually such as
--color
or--version
, so we need to set few parameters in thephpunit.xml
file. - Assertions are the way to check the expected output of the code. There are many assertions available in PHPUnit. We will use
assertEquals()
to check the expected output. - Be ware '--filter', it will run all the tests that match the given pattern. For example, if you have a test named
testOne()
and you run--filter test
, it will run all the tests that contain the wordtest
in their name.