QueuerDetailsFormTest.php in Purge 8.3
File
modules/purge_ui/tests/src/Functional/Form/QueuerDetailsFormTest.php
View source
<?php
namespace Drupal\Tests\purge_ui\Functional\Form;
use Drupal\purge_ui\Form\PluginDetailsForm;
class QueuerDetailsFormTest extends AjaxFormTestBase {
public static $modules = [
'purge_ui',
'purge_queuer_test',
];
protected $formClass = PluginDetailsForm::class;
protected $formId = 'purge_ui.plugin_detail_form';
protected $route = 'purge_ui.queuer_detail_form';
protected $routeParameters = [
'id' => 'a',
];
protected $routeParametersInvalid = [
'id' => 'doesnotexist',
];
protected $routeTitle = 'Queuer A';
public function setUp($switch_to_memory_queue = TRUE) : void {
parent::setUp($switch_to_memory_queue);
$this
->initializeQueuersService([
'a',
]);
}
public function testDetailForm() : void {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet($this
->getPath());
$this
->assertSession()
->responseContains('Queuer A');
$this
->assertSession()
->responseContains('Test queuer A.');
$this
->assertSession()
->responseContains('Close');
$ajax = $this
->postAjaxForm([], 'Close');
$this
->assertAjaxCommandCloseModalDialog($ajax);
$this
->assertAjaxCommandsTotal($ajax, 1);
}
}