← Back to team overview

mahara-contributors team mailing list archive

[Bug 1288439] Re: Existing php unit tests are broken

 

** Changed in: mahara
       Status: New => Triaged

** Changed in: mahara
   Importance: Undecided => Medium

** Changed in: mahara
     Assignee: (unassigned) => Aaron Wells (u-aaronw)

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1288439

Title:
  Existing php unit tests are broken

Status in Mahara ePortfolio:
  Triaged

Bug description:
  The existing phpunit testing does not work. There are several
  problems:

  - uninstall does not remove triggers that are added by notification/internal module, causing errors when trying to re-run testing (when testing, all database objects are deleted then recreated, but the triggers already exist).
  - assertType is no longer available and should use assertInternalType instead (for int value).
  - there is a typo in lib/ddl.php find_key_name function which causes problems when creating and removing the test db tables.
  - there is a logic problem in lib/ddl.php uninstall_from_xmldb_file - array_multisort is being used incorrectly and sometimes causes the primary key to be removed before foreign keys which results in a database error.
  - the function removecolumn in lib/view.php has changed and the test is no longer valid.

  Tested with
  - database postgres
  - mahara master branch

  I've got a patch ready to fix all these issues. With the patch added,
  all existing unit tests pass and testing can be re-run multiple times
  without problems. Obviously many more unit tests should be written,
  but that's another problem. The purpose of this patch is to repair the
  existing testing framework and tests so that additional tests can be
  implemented.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1288439/+subscriptions


References