You are here

public function RulesTestCase::testPassingByReference in Rules 7.2

Same name and namespace in other branches
  1. 8.3 d7-tests/rules_test_case.test \RulesTestCase::testPassingByReference()

Tests passing arguments by reference to an action.

File

tests/rules.test, line 409
Rules tests.

Class

RulesTestCase
Rules test cases.

Code

public function testPassingByReference() {

  // Keeping references of variables is unsupported, though the
  // EntityMetadataArrayObject may be used to achieve that.
  $array = array(
    'foo' => 'bar',
  );
  $data = new EntityMetadataArrayObject($array);
  rules_action('rules_action_test_reference')
    ->execute($data);
  $this
    ->assertTrue($data['changed'], 'Parameter has been passed by reference');
}