Details
-
Type: Sub-task
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Won't Do
-
Affects Version/s: HR-1.0
-
Fix Version/s: HR-1.0
-
Component/s: None
-
Labels:None
Description
api_v3_SyntaxConformanceAllEntitiesTest defines generic tests which should be used with the hrjob entities (HRJob, HRJobPay, HRJobLeave, etc). This is somewhat possible if you call "civix test api_v3_SyntaxConformanceAllEntitiesTest", but there are some issues:
1. The test isn't obviously part of the extension – no one will think to call it on a regular basis.
2. CiviUnitTestCase::_populateDB doesn't recreate option-groups or option-values for the extension, so some tests break. If one adds the following hack, then it executes:
require_once 'CRM/Utils/Migrate/Import.php';
$import = new CRM_Utils_Migrate_Import();
$import->run(
CRM_Extension_System::singleton()>getMapper()>keyToBasePath('org.civicrm.hrjob')
. '/xml/option_group_install.xml');
3. I tried making a new test class, "api_v3_HRJobSyntaxTest extends api_v3_SyntaxConformanceAllEntitiesTest", and overriding _populateDB(), but it fails to load the parent class. (If it did load parent class, then we'd need patch in parent class – mark _populateDB as protocted and s/self::_populateDB/static::_populateDB/)