Skip to content
Snippets Groups Projects
Commit b9dd6a0e authored by Dave Reid's avatar Dave Reid
Browse files

Issue #914210 by jyee, Dave Reid: Added mapper for user raw password.

parent 59604038
No related branches found
No related tags found
No related merge requests found
name = Feeds
description = Aggregates RSS/Atom/RDF feeds, imports CSV files and more.
package = Feeds
core = 7.x
dependencies[] = ctools
dependencies[] = job_scheduler
files[] = feeds.module
files[] = feeds.install
files[] = includes/FeedsConfigurable.inc
files[] = includes/FeedsImporter.inc
files[] = includes/FeedsSource.inc
......@@ -28,5 +29,3 @@ files[] = views/feeds_views_handler_field_log_message.inc
files[] = views/feeds_views_handler_field_severity.inc
files[] = views/feeds_views_handler_field_source.inc
files[] = views/feeds_views_handler_filter_severity.inc
core = 7.x
php = 5.2
......@@ -166,6 +166,10 @@ class FeedsUserProcessor extends FeedsProcessor {
'name' => t('Created date'),
'description' => t('The created (e. g. joined) data of the user.'),
),
'pass' => array(
'name' => t('Unencrypted Password'),
'description' => t('The unencrypted user password.'),
),
);
if (module_exists('openid')) {
$targets['openid'] = array(
......
......@@ -16,28 +16,29 @@ class FeedsWebTestCase extends DrupalWebTestCase {
* please don't pass duplicates of what is defined below!
*/
function setUp() {
// We ensure the taxonomy module is enabled first to prevent issues later
// on where plugins aren't available.
parent::setUp(array('taxonomy'));
$modules = array(
'image',
'file',
'field',
'field_ui',
'ctools',
'job_scheduler',
'feeds',
'feeds_ui',
);
$args = func_get_args();
if (!empty($args[0]) && is_array($args[0])) {
foreach ($args[0] as $m) {
$modules[] = $m;
}
if (isset($args[0]) && is_array($args[0])) {
$modules = $args[0];
}
elseif (count($args) > 1) {
$modules = $args;
}
module_enable($modules, TRUE);
$this->resetAll();
else {
$modules = array();
}
$modules[] = 'taxonomy';
$modules[] = 'image';
$modules[] = 'file';
$modules[] = 'field';
$modules[] = 'field_ui';
$modules[] = 'feeds';
$modules[] = 'feeds_ui';
$modules[] = 'ctools';
$modules[] = 'job_scheduler';
$modules = array_unique($modules);
parent::setUp($modules);
// Add text formats Directly.
$filtered_html_format = array(
......@@ -78,6 +79,7 @@ class FeedsWebTestCase extends DrupalWebTestCase {
'administer nodes',
'administer content types',
'bypass node access',
'administer users',
));
$this->drupalLogin($this->admin_user);
......
name,mail,since
Morticia,morticia@example.com,1244347500
Fester,fester@example.com,1241865600
Gomez,gomez@example.com,1228572000
Wednesday,wednesdayexample.com,1228347137
Pugsley,pugsley@example.com,1228260225
\ No newline at end of file
name,mail,since,password
Morticia,morticia@example.com,1244347500,mort
Fester,fester@example.com,1241865600,fest
Gomez,gomez@example.com,1228572000,gome
Wednesday,wednesdayexample.com,1228347137,wedn
Pugsley,pugsley@example,1228260225,pugs
......@@ -9,7 +9,6 @@
* Test aggregating a feed as data records.
*/
class FeedsCSVtoUsersTest extends FeedsWebTestCase {
public static function getInfo() {
return array(
'name' => 'CSV import to users',
......@@ -18,22 +17,10 @@ class FeedsCSVtoUsersTest extends FeedsWebTestCase {
);
}
/**
* Set up test.
*/
public function setUp() {
parent::setUp();
$this->drupalLogin($this->drupalCreateUser(array(
'administer feeds',
'administer users',
)));
}
/**
* Test node creation, refreshing/deleting feeds and feed items.
*/
public function test() {
// Create an importer.
$this->createImporterConfiguration('User import', 'user_import');
......@@ -59,6 +46,11 @@ class FeedsCSVtoUsersTest extends FeedsWebTestCase {
'target' => 'created',
'unique' => FALSE,
),
'3' => array(
'source' => 'password',
'target' => 'pass',
'unique' => 0,
),
);
$this->addMappings('user_import', $mappings);
......@@ -96,5 +88,11 @@ class FeedsCSVtoUsersTest extends FeedsWebTestCase {
$this->assertEqual($count, 0, t('No imported user was assigned the administrator role.'));
// @todo Test status setting, update existing and role settings.
// Attempt to log in as one of the imported users.
$account = user_load_by_name('Morticia');
$this->assertTrue($account, 'Imported user account loaded.');
$account->pass_raw = 'mort';
$this->drupalLogin($account);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment