moodle/lib/simpletest
tjhunt bb45fe62c4 get_string: Refactoring, performance improvements, bug fixes and unit tests
MDL-18669 get_string refactored to elimiate duplicate code and make it easier to understand.
MDL-17763 parent language not processed correctly when getting a plugin string.
MDL-16181 more intelligent caching to avoid repeated file_exists checks.
MDL-12434 move values to array keys to improve lookup times.

The main part of the refactoring is to create a singleton string_manager class to encapsulate the cached data and the processing, while breaking the code up into more smaller methods.

Other performance improvements include:
* Cache results of plugin name -> locations to search array.
* Cache parent lang lookup.
* Skip eval if the string does not contain $ \ or %.
* Remove the unnecessary sprintf from the eval.

There is a performance testing script in lib/simpletest/getstringperformancetester.php. For now this script has the old get_string implementation copied and pasted to the end, and renamed to old_get_string to allow for comparitive timings.

There are now some unit tests for get_string in lib/simpletest/teststringmanager.php. I think I have managed to cover most of the tricky cases.
2009-03-30 02:21:27 +00:00
..
fixtures MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
get_string_fixtures get_string: Refactoring, performance improvements, bug fixes and unit tests 2009-03-30 02:21:27 +00:00
completion.manualtest.txt MDL-15498: Completion system 2008-07-28 12:31:29 +00:00
getstringperformancetester.php get_string: Refactoring, performance improvements, bug fixes and unit tests 2009-03-30 02:21:27 +00:00
portfolio_testclass.php MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
testaccesslib.php switch roles: MDL-18132 New Role allow switches page finished. 2009-03-25 04:20:57 +00:00
testajaxlib.php ajaxlib: fix unit tests. 2009-03-10 08:01:57 +00:00
testbackuplib.php MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
testcode.php MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
testcompletionlib.php MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
testconditionlib.php MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
testeventslib.php MDL-16483 - partial unbreaking of eventlsib test 2009-01-10 13:54:11 +00:00
testgradelib.php MDL-14967 Upgraded gradebook code and unit tests. 4 failing tests in grade_item to fix. 2008-05-23 14:52:50 +00:00
testmathslib.php MDL-16483 - stopped using MoodleUnitTestCase in tests where $DB not needed 2009-01-10 13:23:37 +00:00
testmoodlelib.php get_string: Refactoring, performance improvements, bug fixes and unit tests 2009-03-30 02:21:27 +00:00
testportfolioaddbutton.php MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
testportfoliolib.php MDL-15666 Testing a matrix of portfolio caller/plugin. Starting the new cleanup method in unit tests (max id) 2008-09-15 13:18:44 +00:00
testquestionlib.php qtype admin: MDL-18425 also related to MDL-18355. 2009-03-03 07:47:32 +00:00
testrepositorylib.php MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
testsimpletestlib.php MDL-16483 - renamed MoodleUnitTestCase to FakeDBUnitTestCase; MDL-17841 removed bogus remove lib/simpletest/slowcodetest.php 2009-01-10 13:47:26 +00:00
teststringmanager.php get_string: Refactoring, performance improvements, bug fixes and unit tests 2009-03-30 02:21:27 +00:00
testunittestusingdb.php unit tests: MDL-18607 new way to do unit tests involving the database. 2009-03-23 04:12:37 +00:00
testweblib.php weblib: Fix test_format_text_email and unit tests. 2009-03-23 03:41:34 +00:00