From 39794f6bb77a3abc1f0dbd4233cde661e6212550 Mon Sep 17 00:00:00 2001 From: Chris Leppanen <chris.leppanen@gmail.com> Date: Wed, 5 Sep 2012 20:50:24 -0700 Subject: [PATCH] Fix path alias test for taxonomy terms. --- plugins/FeedsPlugin.inc | 2 +- tests/feeds_mapper_path.test | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/plugins/FeedsPlugin.inc b/plugins/FeedsPlugin.inc index fa1746bc..be833930 100644 --- a/plugins/FeedsPlugin.inc +++ b/plugins/FeedsPlugin.inc @@ -97,7 +97,7 @@ abstract class FeedsPlugin extends FeedsConfigurable implements FeedsSourceInter $files = drupal_system_listing('/.*\.inc$/', $path, 'name', 0); foreach ($files as $file) { if (strstr($file->uri, '/mappers/')) { - require_once("./$file->uri"); + require_once(DRUPAL_ROOT . '/' . $file->uri); } } } diff --git a/tests/feeds_mapper_path.test b/tests/feeds_mapper_path.test index 01061927..4f5442af 100644 --- a/tests/feeds_mapper_path.test +++ b/tests/feeds_mapper_path.test @@ -86,6 +86,20 @@ class FeedsMapperPathTestCase extends FeedsMapperTestCase { $this->setPlugin('path_test', 'FeedsFileFetcher'); $this->setPlugin('path_test', 'FeedsCSVParser'); $this->setPlugin('path_test', 'FeedsTermProcessor'); + + // Turn on update existing. + $this->setSettings('path_test', 'FeedsTermProcessor', array('update_existing' => 2)); + + // Create vocabulary. + $edit = array( + 'name' => 'Addams vocabulary', + 'machine_name' => 'addams', + ); + $this->drupalPost('admin/structure/taxonomy/add', $edit, t('Save')); + + $this->setSettings('path_test', 'FeedsTermProcessor', array('vocabulary' => 'addams')); + + // Add mappings. $this->addMappings('path_test', array( array( 'source' => 'Title', @@ -102,18 +116,6 @@ class FeedsMapperPathTestCase extends FeedsMapperTestCase { ), )); - // Turn on update existing. - $this->setSettings('path_test', 'FeedsTermProcessor', array('update_existing' => 2)); - - // Create vocabulary. - $edit = array( - 'name' => 'Addams vocabulary', - 'machine_name' => 'addams', - ); - $this->drupalPost('admin/structure/taxonomy/add', $edit, t('Save')); - - $this->setSettings('path_test', 'FeedsTermProcessor', array('vocabulary' => 'addams')); - // Import RSS file. $this->importFile('path_test', $this->absolutePath() . '/tests/feeds/path_alias.csv'); $this->assertText('Created 9 terms'); -- GitLab