Undefined variable and testuite fixes
Tests for libraries/insert_edit.lib.php
Merge pull request #619 from ayushchd/uts_refactored

Unit tests for insert_edit.lib.php