GeocoderTest.php in Geocoder 8.3
File
src/Tests/GeocoderTest.php
View source
<?php
namespace Drupal\geocoder\Tests;
use Drupal\Tests\BrowserTestBase;
class GeocoderTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
protected $strictConfigSchema = FALSE;
public static $modules = [
'geocoder',
];
private $user;
public function setUp() {
parent::setUp();
$this->user = $this
->DrupalCreateUser([
'administer site configuration',
]);
}
public function testMobileJsRedirectPageExists() {
$this
->drupalLogin($this->user);
$this
->drupalGet('admin/config/system/geocoder');
$this
->assertResponse(200);
}
public function testConfigForm() {
$this
->drupalLogin($this->user);
$this
->drupalGet('admin/config/system/geocoder');
$this
->assertResponse(200);
$config = $this
->config('geocoder.settings');
$this
->assertFieldByName('cache', $config
->get('cache'));
$this
->drupalPostForm(NULL, [
'cache' => FALSE,
], t('Save configuration'));
$this
->drupalGet('admin/config/system/geocoder');
$this
->assertResponse(200);
$this
->assertFieldByName('cache', FALSE);
}
}