ImprovedMultiSelectTests.php in Improved Multi Select 8
File
src/Tests/Functional/ImprovedMultiSelectTests.php
View source
<?php
namespace Drupal\improved_multi_select\Tests\Functional;
use Drupal\Tests\BrowserTestBase;
class ImprovedMultiSelectTests extends BrowserTestBase {
protected $defaultTheme = 'stark';
public static $modules = [
'improved_multi_select',
];
public function testImsLoadSelectors() {
$replace_all = FALSE;
$selectors = [];
$jquery_selectors = improved_multi_select_load_selectors($replace_all, $selectors);
$this
->assertIdentical($jquery_selectors, [
'select[multiple]',
]);
$replace_all = TRUE;
$jquery_selectors = improved_multi_select_load_selectors($replace_all, $selectors);
$this
->assertIdentical($jquery_selectors, [
'select[multiple]',
]);
$selectors = [
'test_selector',
];
$jquery_selectors = improved_multi_select_load_selectors($replace_all, $selectors);
$this
->assertIdentical($jquery_selectors, [
'select[multiple]',
]);
$replace_all = FALSE;
$jquery_selectors = improved_multi_select_load_selectors($replace_all, $selectors);
$this
->assertIdentical($jquery_selectors, [
'test_selector',
]);
}
public function testIfDrupalLoads() {
$this
->drupalGet('<front>');
$this
->assertResponse(200);
$user = $this
->drupalCreateUser([
'administer site configuration',
]);
$this
->drupalLogin($user);
$this
->drupalGet('/admin/config/user-interface/ims');
$this
->assertResponse(200);
$this
->drupalLogout();
}
}