Commit beba798c authored by Mikko Rantanen's avatar Mikko Rantanen
Browse files

Issue #2597055 by mikran: Fix broken rules tests.

parent fef2b934
Loading
Loading
Loading
Loading
+1 −1
Changes for relation.rules.inc: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ function relation_rules_load_related($source_entity, $relation_type, $entity_typ
          if (empty($entity_type_op) || $entity_type_op == $property['target_type']) {
            $endpoint_wrapper = entity_metadata_wrapper($property['target_type'], $related_entity);
            if ($endpoint_wrapper->type() != $source_entity_type || $endpoint_wrapper->getIdentifier() != $source_entity_id) {
              $endpoints[] = $related_entity;
              $endpoints[] = $endpoint_wrapper;
            }
          }
        }
+1 −8
Changes for tests/relation.rules.test: 1 added line, 8 removed lines.
Original line number Diff line number Diff line
@@ -17,17 +17,13 @@ class RelationRulesTestCase extends RelationTestCase {
  }

  function setUp() {
    parent::setUp('relation');
    // While setUp fails for non-existing modules, module_enable() doesn't.
    module_enable(array('rules'));
    parent::setUp('relation', 'rules');
  }

  /**
   * Test to create a relation in different ways by executing a rule.
   */
  function testRelationCreateRelation() {
    // We don't want test failures if the Rules module isn't used.
    if (module_exists('rules')) {
    $node = $this->drupalCreateNode(array('type' => 'article'));
    $user = $this->drupalCreateUser();
    $endpoints = array(
@@ -113,10 +109,8 @@ class RelationRulesTestCase extends RelationTestCase {
    $this->drupalPost(NULL, $post, t('Continue'));
    $this->assertText('node:relation-directional-node-reverse:0', t('The created relation porperties\' are found.'));
  }
  }

  function testRelationLoadRelatedRules() {
    if (module_exists('rules')) {
    $nid = $this->node1->nid;
    variable_set('relation_rules_test_nid', $nid);
    module_enable(array('relation_rules_test'));
@@ -135,4 +129,3 @@ class RelationRulesTestCase extends RelationTestCase {
    $this->assertEqual($count, db_query('SELECT COUNT(*) FROM {node} WHERE nid IN (:nids)', array(':nids' => $nids))->fetchField(), t('@count other nodes were found', array('@count' => $count)));
  }
}
}
+1 −0
Changes for tests/relation_rules_test.info: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -3,4 +3,5 @@ description = "Support module for the Relation - Rules integration tests."
package = Testing
core = 7.x
hidden = TRUE
dependencies[] = relation
dependencies[] = rules