Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / pathauto / src / Tests / PathautoNodeWebTest.php
index 95f5eb54c1de932a3bd9be35ebd0322a0fe8541b..78213d2bcf0e43070a6db39c89fe0dd8e507d3d6 100644 (file)
@@ -43,7 +43,6 @@ class PathautoNodeWebTest extends WebTestBase {
       'administer pathauto',
       'administer url aliases',
       'create url aliases',
-      'administer nodes',
       'bypass node access',
       'access content overview',
     );
@@ -64,7 +63,7 @@ class PathautoNodeWebTest extends WebTestBase {
     // Create a node by saving the node form.
     $title = ' Testing: node title [';
     $automatic_alias = '/content/testing-node-title';
-    $this->drupalPostForm(NULL, array('title[0][value]' => $title), t('Save and publish'));
+    $this->drupalPostForm(NULL, array('title[0][value]' => $title), t('Save'));
     $node = $this->drupalGetNodeByTitle($title);
 
     // Look for alias generated in the form.
@@ -82,7 +81,7 @@ class PathautoNodeWebTest extends WebTestBase {
       'path[0][pathauto]' => FALSE,
       'path[0][alias]' => $manual_alias,
     );
-    $this->drupalPostForm($node->toUrl('edit-form'), $edit, t('Save and keep published'));
+    $this->drupalPostForm($node->toUrl('edit-form'), $edit, t('Save'));
     $this->assertText(t('@type @title has been updated.', array('@type' => 'page', '@title' => $title)));
 
     // Check that the automatic alias checkbox is now unchecked by default.
@@ -91,7 +90,7 @@ class PathautoNodeWebTest extends WebTestBase {
     $this->assertFieldByName('path[0][alias]', $manual_alias);
 
     // Submit the node form with the default values.
-    $this->drupalPostForm(NULL, array('path[0][pathauto]' => FALSE), t('Save and keep published'));
+    $this->drupalPostForm(NULL, array('path[0][pathauto]' => FALSE), t('Save'));
     $this->assertText(t('@type @title has been updated.', array('@type' => 'page', '@title' => $title)));
 
     // Test that the old (automatic) alias has been deleted and only accessible
@@ -109,7 +108,7 @@ class PathautoNodeWebTest extends WebTestBase {
       'path[0][pathauto]' => TRUE,
       'path[0][alias]' => '/should-not-get-created',
     );
-    $this->drupalPostForm('node/add/page', $edit, t('Save and publish'));
+    $this->drupalPostForm('node/add/page', $edit, t('Save'));
     $this->assertNoAliasExists(array('alias' => 'should-not-get-created'));
     $node = $this->drupalGetNodeByTitle($title);
     $this->assertEntityAlias($node, '/content/automatic-title');
@@ -130,7 +129,7 @@ class PathautoNodeWebTest extends WebTestBase {
     $edit = array();
     $edit['title'] = 'My test article';
     $this->drupalCreateNode($edit);
-    //$this->drupalPostForm(NULL, $edit, t('Save and keep published'));
+    //$this->drupalPostForm(NULL, $edit, t('Save'));
     $node = $this->drupalGetNodeByTitle($edit['title']);
 
     // Pathauto checkbox should still not exist.
@@ -271,7 +270,7 @@ class PathautoNodeWebTest extends WebTestBase {
       'title[0][value]' => 'Sample article',
       'path[0][alias]' => '/sample-article',
     ];
-    $this->drupalPostForm('node/add/article', $edit, t('Save and publish'));
+    $this->drupalPostForm('node/add/article', $edit, t('Save'));
     $this->assertText(t('article Sample article has been created.'));
 
     // Test the alias.