3 namespace Drupal\Tests\path\Functional;
6 * Tests the Path Node form UI.
10 class PathNodeFormTest extends PathTestBase {
17 public static $modules = ['node', 'path'];
19 protected function setUp() {
22 // Create test user and log in.
23 $web_user = $this->drupalCreateUser(['create page content', 'create url aliases']);
24 $this->drupalLogin($web_user);
28 * Tests the node form ui.
30 public function testNodeForm() {
31 $assert_session = $this->assertSession();
33 $this->drupalGet('node/add/page');
35 // Make sure we have a vertical tab fieldset and 'Path' fields.
36 $assert_session->elementContains('css', '.form-type-vertical-tabs #edit-path-0 summary', 'URL alias');
37 $assert_session->fieldExists('path[0][alias]');
39 // Disable the 'Path' field for this content type.
40 entity_get_form_display('node', 'page', 'default')
41 ->removeComponent('path')
44 $this->drupalGet('node/add/page');
46 // See if the whole fieldset is gone now.
47 $assert_session->elementNotExists('css', '.form-type-vertical-tabs #edit-path-0');
48 $assert_session->fieldNotExists('path[0][alias]');