You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
944 B
19 lines
944 B
10 years ago
|
Unit Tests
|
||
|
==========
|
||
|
|
||
|
> Note: This section is under development.
|
||
|
|
||
|
TODO:
|
||
|
|
||
|
- https://github.com/yiisoft/yii2/blob/master/apps/advanced/README.md#testing
|
||
|
- https://github.com/yiisoft/yii2/blob/master/apps/basic/tests/README.md
|
||
|
|
||
|
A unit test verifies that a single unit of code is working as expected. In object-oriented programming, the most basic
|
||
|
code unit is a class. A unit test thus mainly needs to verify that each of the class interface methods works properly.
|
||
|
That is, given different input parameters, the test verifies the method returns expected results.
|
||
|
Unit tests are usually developed by people who write the classes being tested.
|
||
|
|
||
|
Unit testing in Yii is built on top of PHPUnit and, optionally, Codeception so it's recommended to go through their docs:
|
||
|
|
||
|
- [PHPUnit docs starting from chapter 2](http://phpunit.de/manual/current/en/writing-tests-for-phpunit.html).
|
||
|
- [Codeception Unit Tests](http://codeception.com/docs/06-UnitTests).
|