You are here

class ParserIcalFeedsLocationTestCase in iCal feed parser 7

Same name and namespace in other branches
  1. 6.2 tests/parser_ical_feeds.test \ParserIcalFeedsLocationTestCase

Hierarchy

Expanded class hierarchy of ParserIcalFeedsLocationTestCase

File

tests/parser_ical_feeds.test, line 184

View source
class ParserIcalFeedsLocationTestCase extends ParserIcalFeedsTestCase {

  /**
   * Set up the test.
   */
  public function setUp() {
    parent::setup('text');
  }

  // Call parent setup with the required module.
  public static function getInfo() {
    return array(
      'name' => t('Location'),
      'description' => t('Location parsing and mapping. <strong>Requires Feeds, Date, CCK Text (and in the future geo) module.</strong>'),
      'group' => t('iCal Parser'),
    );
  }
  public function createConfiguredFeed() {
    $typename = parent::createConfiguredFeed(array(
      'location' => array(
        'type' => 'text',
      ),
    ));
    $this
      ->addMappings('ical', array(
      array(
        'source' => 'ical_location',
        'target' => 'field_location',
      ),
    ));
    return $typename;
  }

  /**
   * Basic test using Location.ics
   */
  public function testLocationFeed() {
    $typename = $this
      ->createConfiguredFeed();

    // Import iCal file.
    $this
      ->importFile('ical', $this
      ->absolutePath() . '/tests/feeds/Location.ics');
    $this
      ->assertText('Created 3 ' . $typename . ' nodes.');

    // Check the imported nodes.
    // Timezones
    $data = array(
      array(
        'title' => 'Basic location',
        'location' => 'Text location',
      ),
    );
    for ($i = 1; $i <= count($data); $i++) {
      $this
        ->drupalGet("node/{$i}/edit");
      $this
        ->assertNodeFieldValue('location', $d['location']);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ParserIcalFeedsLocationTestCase::createConfiguredFeed public function Basic test configured feed item, to import feed into. Overrides ParserIcalFeedsTestCase::createConfiguredFeed
ParserIcalFeedsLocationTestCase::getInfo public static function
ParserIcalFeedsLocationTestCase::setUp public function Set up the test. Overrides ParserIcalFeedsTestCase::setUp
ParserIcalFeedsLocationTestCase::testLocationFeed public function Basic test using Location.ics
ParserIcalFeedsTestCase::absolutePath public function
ParserIcalFeedsTestCase::assertCCKFieldTimezone protected function
ParserIcalFeedsTestCase::assertCCKFieldValue2 protected function assertCCKFieldValue uses an XPath on the CCK fields on the form, the method looks in 'value' and for plain text the end date is a 'value2'
ParserIcalFeedsTestCase::getFormFieldsNames protected function Return the form field name for a given CCK field. Special handling for date fields.