Note:

This site is no longer used and is in read-only mode. Instead please go to our new Moodle Developer Resource site.

SimpleTest conversion

From MoodleDocs
Revision as of 19:35, 20 April 2012 by Petr Škoda (škoďák) (talk | contribs) (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<...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

The migration is pretty straightforward:

  1. create new test file in `xxx/tests/yyy_test.php`
  2. copy contents of the old test file
  3. replace extends UnitTestCase with extends basic_testcase and extends UnitTestCaseUsingDatabase with extends advanced_testcase
  4. move constructor code to setUp
  5. fix setUp(), tearDown()
  6. fix assert syntax

Assert differences