diff --git a/tests/rules.test b/tests/rules.test index 20f1c9d..b99590d 100644 --- a/tests/rules.test +++ b/tests/rules.test @@ -1607,6 +1607,16 @@ class RulesIntegrationTestCase extends DrupalWebTestCase { $tid = $term_wrapped->getIdentifier(); $this->assertEqual(array_values($node->field_tags[LANGUAGE_NONE]), array(0 => array('tid' => $tid)), 'Entity has field conditions evaluted.'); + // Test asserting the property and using it afterwards. + $rule = rule(array('entity' => array('type' => 'entity'))); + $rule->condition('entity_has_property', array('entity:select' => 'entity', 'field' => 'status')); + $rule->action('data_set', array('data:select' => 'entity:status', 'value' => '5')); + $rule->integrityCheck(); + $rule->execute($node); + + // We use an invalid state to ensure it's not set by any default + $this->assertEqual($node->status, 5, 'Entity has property condition evaluted.'); + // Test loading a non-node entity. $action = rules_action('entity_fetch', array('type' => 'taxonomy_term', 'id' => $tid)); list($term) = $action->execute();