You are here

public function ParserTest::testParsingOfInformation in Weather 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/ParserTest.php \Drupal\Tests\weather\Functional\ParserTest::testParsingOfInformation()

Test parsing of information about a forecast.

File

tests/src/Functional/ParserTest.php, line 516

Class

ParserTest
Tests parsing of XML weather forecasts.

Namespace

Drupal\Tests\weather\Functional

Code

public function testParsingOfInformation() {

  // 2013-10-07 20:00:00 UTC.
  $info = $this
    ->getInfoAboutForecast(1381176000);

  // Check that the information has been parsed correctly.
  $this
    ->assertEquals('geonames_2911298', $info->geoid);
  $this
    ->assertEquals('2013-10-07 15:30:00', $info->last_update);
  $this
    ->assertEquals('2013-10-08 04:00:00', $info->next_update);
  $this
    ->assertEquals('2013-10-08 04:00:00', $info->next_download_attempt);
  $this
    ->assertEquals(120, $info->utc_offset);
}