Unit Test PHP

Source: Internet
Author: User
Test of PHP
PHPUNIT on the installation.


The introduction of basic pre-environment and conditions.


Write the main boundary conditions.
Consider decoupling.


The point is that the code is written as a class, the way it looks.
Don't be process-oriented. One line after the other. If this is the case, you won't be able to test it without adding a breakpoint.
But adding breakpoints is not what we're after. Unit tests that do not interfere with the work code.


About decoupling: Another point is that it is convenient to compare small units to test
This makes it easy to judge the test results.
But can not be too small, too small to test the significance of little.


Unit tests must also be written during the development process.






The article about testing, mainly 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.