comparison core/modules/user/tests/src/Functional/UserEditTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children af1871eacc83
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
1 <?php 1 <?php
2 2
3 namespace Drupal\Tests\user\Functional; 3 namespace Drupal\Tests\user\Functional;
4 4
5 use Drupal\Core\Cache\Cache;
5 use Drupal\Tests\BrowserTestBase; 6 use Drupal\Tests\BrowserTestBase;
6 7
7 /** 8 /**
8 * Tests user edit page. 9 * Tests user edit page.
9 * 10 *
27 28
28 // Check that the default value in user name field 29 // Check that the default value in user name field
29 // is the raw value and not a formatted one. 30 // is the raw value and not a formatted one.
30 \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE); 31 \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
31 \Drupal::service('module_installer')->install(['user_hooks_test']); 32 \Drupal::service('module_installer')->install(['user_hooks_test']);
33 Cache::invalidateTags(['rendered']);
32 $this->drupalGet('user/' . $user1->id() . '/edit'); 34 $this->drupalGet('user/' . $user1->id() . '/edit');
33 $this->assertFieldByName('name', $user1->getAccountName()); 35 $this->assertFieldByName('name', $user1->getAccountName());
36
37 // Ensure the formatted name is displayed when expected.
38 $this->drupalGet('user/' . $user1->id());
39 $this->assertSession()->responseContains($user1->getDisplayName());
40 $this->assertSession()->titleEquals(strip_tags($user1->getDisplayName()) . ' | Drupal');
34 41
35 // Check that filling out a single password field does not validate. 42 // Check that filling out a single password field does not validate.
36 $edit = []; 43 $edit = [];
37 $edit['pass[pass1]'] = ''; 44 $edit['pass[pass1]'] = '';
38 $edit['pass[pass2]'] = $this->randomMachineName(); 45 $edit['pass[pass2]'] = $this->randomMachineName();