Skip to content
Snippets Groups Projects
Commit b0a545df authored by Nikolay Shapovalov's avatar Nikolay Shapovalov Committed by Sascha Grossenbacher
Browse files

Issue #3412266: Fix phpunit erros on Drupal 10.2

parent 1312e892
No related merge requests found
......@@ -48,7 +48,8 @@ include:
################
# variables:
# SKIP_ESLINT: '1'
variables:
OPT_IN_TEST_PREVIOUS_MINOR: '1'
###################################################################################
#
......
......@@ -113,7 +113,7 @@ class PathautoBulkUpdateTest extends BrowserTestBase {
// Make sure existing aliases can be overridden.
$this->drupalGet('admin/config/search/path/settings');
$this->submitForm(['update_action' => PathautoGeneratorInterface::UPDATE_ACTION_DELETE], 'Save configuration');
$this->submitForm(['update_action' => (string) PathautoGeneratorInterface::UPDATE_ACTION_DELETE], 'Save configuration');
// Patterns did not change, so no aliases should be regenerated.
$edit['action'] = 'all';
......@@ -134,10 +134,7 @@ class PathautoBulkUpdateTest extends BrowserTestBase {
// Prevent existing aliases to be overridden. The bulk generate page should
// only offer to create an alias for paths which have none.
$this->drupalGet('admin/config/search/path/settings');
$this->submitForm(
['update_action' => PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW],
'Save configuration'
);
$this->submitForm(['update_action' => (string) PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW], 'Save configuration');
$this->drupalGet('admin/config/search/path/update_bulk');
$this->assertSession()->fieldValueEquals('action', 'create');
......
......@@ -181,8 +181,7 @@ class PathautoLocaleTest extends WebDriverTestBase {
];
$this->drupalGet('admin/config/search/path/update_bulk');
$this->submitForm($edit, 'Update');
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertSession()->pageTextContains('Generated 2 URL aliases.');
$this->assertSession()->waitForText('Generated 2 URL aliases.');
$this->assertAlias('/node/' . $node->id(), '/the-articles/english-node', 'en');
$this->assertAlias('/node/' . $node->id(), '/les-articles/french-node', 'fr');
}
......@@ -216,12 +215,18 @@ class PathautoLocaleTest extends WebDriverTestBase {
protected function enableArticleTranslation() {
// Enable content translation on articles.
$this->drupalGet('admin/config/regional/content-language');
$edit = [
'entity_types[node]' => TRUE,
'settings[node][article][translatable]' => TRUE,
'settings[node][article][settings][language][language_alterable]' => TRUE,
];
$this->submitForm($edit, 'Save configuration');
// Enable translation for node.
$this->assertSession()->fieldExists('entity_types[node]')->check();
// Open details for Content settings in Drupal 10.2.
$nodeSettings = $this->getSession()->getPage()->find('css', '#edit-settings-node summary');
if ($nodeSettings) {
$nodeSettings->click();
}
$this->assertSession()->fieldExists('settings[node][article][translatable]')->check();
$this->assertSession()->fieldExists('settings[node][article][settings][language][language_alterable]')->check();
$this->getSession()->getPage()->pressButton('Save configuration');
}
}
......@@ -202,9 +202,9 @@ class PathautoUiTest extends WebDriverTestBase {
$this->clickLink('Delete');
$this->assertSession()->assertWaitOnAjaxRequest();
if (version_compare(\Drupal::VERSION, '10.1', '>=')) {
$this->assertSession()->pageTextContains('This action cannot be undone.');
$this->getSession()->getPage()->find('css', '.ui-dialog-buttonpane')->findButton('Delete')->press();
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', '#drupal-modal'));
$this->assertSession()->elementContains('css', '#drupal-modal', 'This action cannot be undone.');
$this->assertSession()->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Delete');
}
else {
$address = Url::fromRoute('entity.pathauto_pattern.delete_form', ['pathauto_pattern' => 'page_pattern'], [$destination_query]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment