Posted By

steroidmonkey on 11/09/13


Tagged

php testing unit phpunit


Versions (?)

PHPUnit Test Outline


 / Published in: PHP
 

Bare outline for a PHPUnit test case

  1. <?php
  2. require_once 'MyClass.php';
  3.  
  4. class MyClassTest extends PHPUnit_Framework_TestCase
  5. {
  6. protected $my_class_instance;
  7.  
  8. protected function setUp()
  9. {
  10. $this->my_class_instance = new MyClass;
  11. }
  12.  
  13. public function testYourTest()
  14. {
  15. //Write your assertions here.
  16. }
  17.  
  18. }

Report this snippet  

You need to login to post a comment.