You are here

public function FeedsTamperWebTestCase::testBasic in Feeds Tamper 7

Same name and namespace in other branches
  1. 6 tests/feeds_tamper.test \FeedsTamperWebTestCase::testBasic()

File

tests/feeds_tamper.test, line 177
Tests for feeds_tamper.module.

Class

FeedsTamperWebTestCase
Simple tests for api functionality.

Code

public function testBasic() {

  // Test basic plugin adding.
  // Add a no-op explode/implode sequence to verify that we can switch types.
  $this
    ->addTamperPlugin('syndication', 'title', 'explode', array(
    'separator' => '$',
    'limit' => '',
  ));
  $id = $this
    ->addTamperPlugin('syndication', 'title', 'convert_case', array(
    'mode' => 0,
  ));
  $this
    ->addTamperPlugin('syndication', 'title', 'implode', array(
    'glue' => '',
  ));

  // Create feed node, running import automatically.
  $nid = $this
    ->createFeedNode();

  // Assert that all titles were uppercased.
  $this
    ->assertUppercaseDevseedFeedContent();

  // Disable plugin.
  $this
    ->disableTamperPlugin($id);

  //$this->deleteTamperPlugin($id);
  $this
    ->drupalPost('node/' . $nid . '/import', array(), 'Import');
  $this
    ->assertText('Updated 10 nodes.');
  $this
    ->assertDevseedFeedContent();
}