You are here

public function FeedsWebTestCase::createImporterConfiguration in Feeds 7.2

Same name and namespace in other branches
  1. 6 tests/feeds.test \FeedsWebTestCase::createImporterConfiguration()
  2. 7 tests/feeds.test.inc \FeedsWebTestCase::createImporterConfiguration()

Create an importer configuration.

Parameters

$name: The natural name of the feed.

$id: The persistent id of the feed.

$edit: Optional array that defines the basic settings for the feed in a format that can be posted to the feed's basic settings form.

84 calls to FeedsWebTestCase::createImporterConfiguration()
FeedsAccountSwitcherTest::setUp in tests/FeedsAccountSwitcherTest.test
Sets up a Drupal site for running functional and integration tests.
FeedsContentTypeTest::setUp in tests/feeds_content_type.test
Sets up a Drupal site for running functional and integration tests.
FeedsCSVParserTestCase::testEncodingFailure in tests/feeds_parser_csv.test
Tests an encoding failure during parsing a CSV.
FeedsCSVParserTestCase::testGetTemplate in tests/feeds_parser_csv.test
Tests if a CSV template is generated properly using various settings.
FeedsCSVParserTestCase::testMbstringExtensionDisabled in tests/feeds_parser_csv.test
Tests parsing a CSV when the mbstring extension is not available.

... See full list

File

tests/feeds.test, line 191
Common functionality for all Feeds tests.

Class

FeedsWebTestCase
Test basic Data API functionality.

Code

public function createImporterConfiguration($name = 'Syndication', $id = 'syndication') {

  // Create new feed configuration.
  $this
    ->drupalGet('admin/structure/feeds');
  $this
    ->clickLink('Add importer');
  $edit = array(
    'name' => $name,
    'id' => $id,
  );
  $this
    ->drupalPost('admin/structure/feeds/create', $edit, 'Create');

  // Assert message and presence of default plugins.
  $this
    ->assertText('Your configuration has been created with default settings.');
  $this
    ->assertPlugins($id, 'FeedsHTTPFetcher', 'FeedsSyndicationParser', 'FeedsNodeProcessor');

  // Per default attach to page content type.
  $this
    ->setSettings($id, NULL, array(
    'content_type' => 'page',
  ));

  // Per default attached to article content type.
  $this
    ->setSettings($id, 'FeedsNodeProcessor', array(
    'bundle' => 'article',
  ));
}