You are here

protected function FeedsRulesTest::createTestRule in Feeds 7.2

Creates a test rule.

Parameters

string $event: The event to react on.

bool $action: If a dummy action should be executed.

Return value

RulesReactionRule An instance of RulesReactionRule.

7 calls to FeedsRulesTest::createTestRule()
FeedsRulesTest::testFeedsAfterImportEvent in tests/feeds_rules.test
Tests if the Rules event 'feeds_after_import' is invoked.
FeedsRulesTest::testFeedsBeforeImportEvent in tests/feeds_rules.test
Tests if the Rules event 'feeds_before_import' is invoked.
FeedsRulesTest::testFeedsBeforeSavingItemEvent in tests/feeds_rules.test
Tests if the Rules event 'feeds_import_IMPORTER_ID' is invoked.
FeedsRulesTest::testFeedsImportAction in tests/feeds_rules.test
Tests the Rules action 'feeds_import_feed'.
FeedsRulesTest::testFeedsImportActionUsingStandaloneForm in tests/feeds_rules.test
Tests the Rules action 'feeds_import_feed' with standalone form.

... See full list

File

tests/feeds_rules.test, line 66
Contains FeedsRulesTest.

Class

FeedsRulesTest
Tests for Rules integration.

Code

protected function createTestRule($event, $action = TRUE) {
  $rule = rules_reaction_rule();
  $rule
    ->event($event);
  if ($action) {
    $rule
      ->action('feeds_tests_create_node');
  }
  return $rule;
}