← Back to team overview

mahara-contributors team mailing list archive

[Bug 1288439] A change has been merged

 

Reviewed:  https://reviews.mahara.org/3079
Committed: http://gitorious.org/mahara/mahara/commit/774a884c7be6ec47c1d1841f569d2f231621dfaa
Submitter: Aaron Wells (aaronw@xxxxxxxxxxxxxxx)
Branch:    master

commit 774a884c7be6ec47c1d1841f569d2f231621dfaa
Author: Nathan Lewis <nathan.lewis@xxxxxxxxxxxxx>
Date:   Thu Mar 6 11:35:09 2014 +1300

Fix phpunit testing framework (Bug #1288439)

- 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.

Change-Id: Ibee48e557912e09cf6533132ba771bfb2c44749f
Signed-off-by: Nathan Lewis <nathan.lewis@xxxxxxxxxxxxx>

-- 
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