Uploaded image for project: 'CiviHR'
  1. CiviHR
  2. HR-20 CiviHR - Entity - Job Positions & Roles
  3. HR-61

Run api_v3_SyntaxConformanceAllEntitiesTest with hrjob API's

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

        Attachments

          Activity

            People

            • Assignee:
              ravish.nair Ravish Nair
              Reporter:
              timotten Tim Otten
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 5 hours, 34 minutes
                2d 5h 34m