Commit 4a735f98 authored by tlyngej's avatar tlyngej

Migrate a simpletest to PHPUnit test

parent a6e1775b
<?php
namespace Drupal\config_ignore\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Class ConfigIgnoreSettingsTest.
*
* @package Drupal\config_ignore\Tests
* @group config_ignore
*/
class ConfigIgnoreSettingsTest extends WebTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['config_ignore'];
/**
* Verify that the settings form works.
*/
public function testSettingsForm() {
// Login with a user that has permission to import config.
$this->drupalLogin($this->drupalCreateUser(['import configuration']));
$edit = [
'ignored_config_entities' => 'config.test',
];
$this->drupalPostForm('admin/config/development/configuration/ignore', $edit, t('Save configuration'));
$settings = $this->config('config_ignore.settings')->get('ignored_config_entities');
$this->assertEqual($settings, ['config.test']);
}
}
......@@ -48,4 +48,23 @@ class ConfigIgnoreTest extends ConfigIgnoreBrowserTestBase {
$this->assertFalse(in_array('system.date', $table_values));
}
/**
* Verify that the settings form works.
*/
public function testSettingsForm() {
// Login with a user that has permission to import config.
$this->drupalLogin($this->drupalCreateUser(['import configuration']));
$edit = [
'ignored_config_entities' => 'config.test',
];
$this->drupalGet('admin/config/development/configuration/ignore');
$this->submitForm($edit, t('Save configuration'));
$settings = $this->config('config_ignore.settings')->get('ignored_config_entities');
$this->assertEqual($settings, ['config.test']);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment