Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8959

Drupal module is incompatibile with third-party Simpletest cases

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.4.4
    • Fix Version/s: 4.1.0
    • Component/s: Test suite
    • Labels:
      None

      Description

      Any Simpletest test case depending on civicrm will crash during setUp() on the second test, with an error like,
      > "Could not find access_callback in path tree, Could not find access_arguments in path tree, Could not find page_callback in path tree, Could not find page_arguments in path tree, Could not find is_ssl in path tree"

      Try extending this wrapper class when writing Simpletest cases:
      <pre>
      class civicrm_simpletest_case extends DrupalWebTestCase
      {
      function setUp(/* requires */)
      {
      $requires = func_get_args();
      $requires = array_merge(array('civicrm'), $requires);
      parent::setUp();
      foreach ($requires as $module)

      { drupal_install_modules(array($module)); }

      $this->assertTrue(civicrm_initialize(), "Civicrm couldn't be initialized");
      }
      function tearDown()

      { //XXX this is the workaround: CRM_Core_Menu::$_items = null; parent::tearDown(); }

      }
      </pre>

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              adamw Adam Wight
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: