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 $this->drupalGet('node/add/page');
33 // Make sure we have a Path fieldset and Path fields.
34 $this->assertRaw(' id="edit-path-settings"', 'Path settings details exists');
35 $this->assertFieldByName('path[0][alias]', NULL, 'Path alias field exists');
37 // Disable the Path field for this content type.
38 entity_get_form_display('node', 'page', 'default')
39 ->removeComponent('path')
42 $this->drupalGet('node/add/page');
44 // See if the whole fieldset is gone now.
45 $this->assertNoRaw(' id="edit-path-settings"', 'Path settings details does not exist');
46 $this->assertNoFieldByName('path[0][alias]', NULL, 'Path alias field does not exist');