FunctionsTest.php in Weather 8
File
tests/src/Functional/FunctionsTest.php
View source
<?php
namespace Drupal\Tests\weather\Functional;
use Drupal\Tests\BrowserTestBase;
class FunctionsTest extends BrowserTestBase {
use WeatherCommonTestTrait;
public static $modules = [
'weather',
];
protected $defaultTheme = 'stark';
public function testFunctionWeatherGetLinkForGeoId() {
$this
->weatherFillWeatherSchema();
$link = $this
->weatherGetInformationAboutGeoid('geonames_2911298')['link'];
$this
->assertEqual($link, 'Hamburg/Hamburg');
$link = $this
->weatherGetLinkForGeoId('geonames_2911298', 'yr.no');
$this
->assertEqual($link, 'http://www.yr.no/place/Germany/Hamburg/Hamburg/');
$link = $this
->weatherGetLinkForGeoId('geonames_2911298', 'system-wide');
$this
->assertEqual($link, 'weather/Germany/Hamburg/Hamburg/1');
$link = $this
->weatherGetLinkForGeoId('geonames_2911298', 'default');
$this
->assertEqual($link, 'weather/Germany/Hamburg/Hamburg');
$link = $this
->weatherGetLinkForGeoId('geonames_2911298', 'user');
$this
->assertEqual($link, 'weather/Germany/Hamburg/Hamburg/u');
$link = $this
->weatherGetLinkForGeoId('geonames_2911298', 'yr');
$this
->assertEqual($link, 'http://www.yr.no/place/Germany/Hamburg/Hamburg/forecast.xml');
}
}