QueueDetailsFormTest.php in Purge 8.3
File
modules/purge_ui/tests/src/Functional/Form/QueueDetailsFormTest.php
View source
<?php
namespace Drupal\Tests\purge_ui\Functional\Form;
use Drupal\purge_ui\Form\PluginDetailsForm;
class QueueDetailsFormTest extends AjaxFormTestBase {
public static $modules = [
'purge_ui',
'purge_queue_test',
];
protected $formClass = PluginDetailsForm::class;
protected $formId = 'purge_ui.plugin_detail_form';
protected $route = 'purge_ui.queue_detail_form';
protected $routeTitle = 'Memory';
public function setUp($switch_to_memory_queue = TRUE) : void {
parent::setUp($switch_to_memory_queue);
$this
->initializeQueueService();
}
public function testDetailForm() : void {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet($this
->getPath());
$this
->assertSession()
->responseContains('Memory');
$this
->assertSession()
->responseContains('A non-persistent, per-request memory queue (not useful on production systems).');
$this
->assertSession()
->responseContains('Close');
$ajax = $this
->postAjaxForm([], 'Close');
$this
->assertAjaxCommandCloseModalDialog($ajax);
$this
->assertAjaxCommandsTotal($ajax, 1);
}
}