Unit test PHP

Source: Internet
Author: User
Unit testing PHP testing
PHPUNIT installation.


Introduce basic preconditions and conditions.


Write the primary boundary condition.
Consider decoupling.


Specifically, the code is written as a class and a method.
Not process-oriented. One line followed by one line. In this case, you cannot test it without adding a breakpoint.
However, adding breakpoints is not what we are pursuing. Unit tests that do not interfere with working code.


Decoupling: It is also easier to test small units.
This makes it easy to judge the test results.
However, it cannot be too small. testing too small is of little significance.


Unit tests must also be written during development.






The article on testing is mainly about unit testing:
Http://segmentfault.com/q/1010000000692485

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.