class ParserIcalCreatorLocationCase in iCal feed parser 7.2
Class for testing iCal (iCalCreator) location mapping.
Hierarchy
- class \ParserIcalFeedsTestCase extends \FeedsMapperTestCase
- class \ParserIcalLocationTestCase
Expanded class hierarchy of ParserIcalCreatorLocationCase
File
- tests/
parser_ical_location.test, line 112 - Test case for CCK ical date field text mapper.
View source
class ParserIcalCreatorLocationCase extends ParserIcalLocationTestCase {
public static function getInfo() {
return array(
'name' => 'Location (iCalCreator)',
'description' => 'Test location import support.',
'group' => 'Parser iCal',
);
}
public function configureParser() {
$this
->setPlugin('ical', 'ParserIcalCreator');
}
/**
* Test location altrep. Only present in iCalCreator.
*/
public function testLocationAlt() {
// Create content type.
$typename = $this
->createContentType(array(), array(
'alpha' => 'text',
));
$this
->createImporterConfiguration('iCal importer', 'ical');
$this
->setSettings('ical', NULL, array(
'content_type' => '',
'import_period' => FEEDS_SCHEDULE_NEVER,
));
$this
->setPlugin('ical', 'FeedsFileFetcher');
$this
->setSettings('ical', 'FeedsFileFetcher', array(
'allowed_extensions' => 'ics ical',
));
$this
->configureParser();
$this
->setSettings('ical', 'FeedsNodeProcessor', array(
'content_type' => $typename,
));
$this
->addMappings('ical', array(
array(
'source' => 'uid',
'target' => 'guid',
),
array(
'source' => 'summary',
'target' => 'title',
),
array(
'source' => 'location:altrep',
'target' => 'field_alpha',
),
));
// Import iCal file
$this
->importFile('ical', $this
->absolutePath() . '/tests/feeds/location.ics');
$this
->assertText('Created 3 nodes');
$this
->drupalGet('node/1/edit');
$this
->assertFieldByName('field_alpha[und][0][value]', '', 'Feed item 1 location altparam text correct.');
$this
->drupalGet('node/2/edit');
$this
->assertFieldByName('field_alpha[und][0][value]', 'http://example.com/conf-rooms/f123.vcf', 'Feed item 2 location altparam text correct.');
$this
->drupalGet('node/3/edit');
$this
->assertFieldByName('field_alpha[und][0][value]', 'http://upcoming.yahoo.com/venue/915640/', 'Feed item 3 location altparam text correct.');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ParserIcalCreatorLocationCase:: |
public | function |
Set and configure the parser plugin. Overrides ParserIcalLocationTestCase:: |
|
ParserIcalCreatorLocationCase:: |
public static | function | ||
ParserIcalCreatorLocationCase:: |
public | function | Test location altrep. Only present in iCalCreator. | |
ParserIcalFeedsTestCase:: |
public | function | ||
ParserIcalFeedsTestCase:: |
public | function | Set up the test. | 2 |
ParserIcalLocationTestCase:: |
function | Correct assertions. This is overridden in the (date api) test, as it's slightly broken. | 1 | |
ParserIcalLocationTestCase:: |
function | Basic test on simple ical file. |