I wondered about the complexity of the test. I'd expect to break down each part and test each individually. Rather than all at once.
I've attached patch that implements what you agreed earlier with sam
Procedure for portfolio unit tests (agreed with Penny):
1. Comment out all the tests (so that running them will give 0 passes, 0 fails, 0 exceptions).
2. Near top of file add this comment:
- TODO: The portfolio unit tests were obselete and did not work.
- They have been commented out so that they do not break the
- unit tests in Moodle 2.
- At some point:
- 1. These tests should be audited to see which ones were valuable.
- 2. The useful ones should be rewritten using the current standards
- for writing test cases.
- This might be left until Moodle 2.1 when the test case framework
- is due to change.
3. If there are specific warnings about a particular test (ie 'this test potentially nuked the real database'), you can add those at the end of the comment.
I've left in the changes I made to get it using the new UnitTestCaseUsingDatabase class and then commented out the test.
The test report now reads 0/1 test cases complete: 0 passes, 0 fails and 0 exceptions.
Hope this is good enough for now.