SimpleTest conversion: Difference between revisions
From MoodleDocs
Created page with "=Overview= The migration is pretty straightforward: # create new test file in `xxx/tests/yyy_test.php` # copy contents of the old test file # replace <code>extends UnitTestCase<..." |
|||
| Line 8: | Line 8: | ||
# fix setUp(), tearDown() | # fix setUp(), tearDown() | ||
# fix assert syntax | # fix assert syntax | ||
# add $this->resetAfterTest() in advanced test cases that modify database | |||
=Assert differences= | =Assert differences= | ||
Revision as of 19:36, 20 April 2012
Overview
The migration is pretty straightforward:
- create new test file in `xxx/tests/yyy_test.php`
- copy contents of the old test file
- replace
extends UnitTestCasewithextends basic_testcaseandextends UnitTestCaseUsingDatabasewithextends advanced_testcase - move constructor code to setUp
- fix setUp(), tearDown()
- fix assert syntax
- add $this->resetAfterTest() in advanced test cases that modify database