contrib modules security updates
This commit is contained in:
@@ -17,6 +17,10 @@ class FeedsUIUserInterfaceTestCase extends FeedsWebTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp(array('php'), array('use PHP for settings'));
|
||||
}
|
||||
|
||||
/**
|
||||
* UI functionality tests on
|
||||
* feeds_ui_overview(),
|
||||
@@ -87,7 +91,7 @@ class FeedsUIUserInterfaceTestCase extends FeedsWebTestCase {
|
||||
'content_type' => 'page',
|
||||
'import_period' => 3600,
|
||||
);
|
||||
$this->drupalPost('admin/structure/feeds/test_feed/settings', $edit, 'Save');
|
||||
$this->setSettings('test_feed', NULL, $edit);
|
||||
|
||||
// Assert results of change.
|
||||
$this->assertText('Syndication feed');
|
||||
@@ -98,11 +102,8 @@ class FeedsUIUserInterfaceTestCase extends FeedsWebTestCase {
|
||||
$this->assertLink('Basic page');
|
||||
|
||||
// Configure processor.
|
||||
$edit = array(
|
||||
'content_type' => 'article',
|
||||
);
|
||||
$this->drupalPost('admin/structure/feeds/test_feed/settings/FeedsNodeProcessor', $edit, 'Save');
|
||||
$this->assertFieldByName('content_type', 'article');
|
||||
$this->setSettings('test_feed', 'FeedsNodeProcessor', array('bundle' => 'article'));
|
||||
$this->assertFieldByName('bundle', 'article');
|
||||
|
||||
// Create a feed node.
|
||||
$edit = array(
|
||||
@@ -114,4 +115,46 @@ class FeedsUIUserInterfaceTestCase extends FeedsWebTestCase {
|
||||
|
||||
// @todo Refreshing/deleting feed items. Needs to live in feeds.test
|
||||
}
|
||||
|
||||
public function testImporterImport() {
|
||||
$name = $this->randomString();
|
||||
$id = drupal_strtolower($this->randomName());
|
||||
$this->createImporterConfiguration($name, $id);
|
||||
$this->setPlugin($id, 'FeedsCSVParser');
|
||||
$this->setPlugin($id, 'FeedsFileFetcher');
|
||||
$this->setPlugin($id, 'FeedsUserProcessor');
|
||||
|
||||
$this->setSettings($id, 'FeedsFileFetcher', array('allowed_extensions' => 'xml'));
|
||||
$this->setSettings($id, 'FeedsCSVParser', array('delimiter' => '|'));
|
||||
$this->setSettings($id, 'FeedsUserProcessor', array('skip_hash_check' => TRUE));
|
||||
|
||||
$this->drupalGet('admin/structure/feeds/' . $id . '/export');
|
||||
|
||||
$export = $this->xpath('//textarea[1]/text()');
|
||||
$export = (string) $export[0];
|
||||
|
||||
// Delete this importer.
|
||||
$this->drupalPost('admin/structure/feeds/' . $id . '/delete', array(), t('Delete'));
|
||||
|
||||
// Try to import.
|
||||
$this->drupalPost('admin/structure/feeds/import', array('importer' => $export), t('Import'));
|
||||
|
||||
$this->assertText("Successfully imported the $id feeds importer.");
|
||||
|
||||
// Check that the settings are correct.
|
||||
$importer = feeds_importer($id);
|
||||
$this->assertEqual('FeedsFileFetcher', get_class($importer->fetcher));
|
||||
$this->assertEqual('FeedsCSVParser', get_class($importer->parser));
|
||||
$this->assertEqual('FeedsUserProcessor', get_class($importer->processor));
|
||||
|
||||
$config = $importer->fetcher->getConfig();
|
||||
$this->assertEqual('xml', $config['allowed_extensions']);
|
||||
|
||||
$config = $importer->parser->getConfig();
|
||||
$this->assertEqual('|', $config['delimiter']);
|
||||
|
||||
$config = $importer->processor->getConfig();
|
||||
$this->assertTrue($config['skip_hash_check']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user