diff --git a/core/modules/user/tests/modules/user_form_test/lib/Drupal/user_form_test/Form/TestCurrentPassword.php b/core/modules/user/tests/modules/user_form_test/lib/Drupal/user_form_test/Form/TestCurrentPassword.php index 724a573..e05c87c 100644 --- a/core/modules/user/tests/modules/user_form_test/lib/Drupal/user_form_test/Form/TestCurrentPassword.php +++ b/core/modules/user/tests/modules/user_form_test/lib/Drupal/user_form_test/Form/TestCurrentPassword.php @@ -7,13 +7,13 @@ namespace Drupal\user_form_test\Form; -use Drupal\Core\Form\FormInterface; -use Drupal\user\Plugin\Core\Entity\User; +use Drupal\Core\Form\FormBase; +use Drupal\user\Entity\User; /** - * Base class for implementing system configuration forms. + * Provides a current password validation form. */ -class TestCurrentPassword implements FormInterface { +class TestCurrentPassword extends FormBase { /** * {@inheritdoc} @@ -25,51 +25,43 @@ public function getFormID() { /** * {@inheritdoc} * - * @param Drupal\user\Plugin\Core\Entity\User $account + * @param \Drupal\user\Entity\User $user * The user account. */ public function buildForm(array $form, array &$form_state, User $user = NULL) { - $user = $user->getBCEntity(); - $user->user_form_test_field = ''; $form_state['user'] = $user ; $form['user_form_test_field'] = array( '#type' => 'textfield', - '#title' => t('Test field'), - '#description' => t('A field that would require a correct password to change.'), + '#title' => $this->t('Test field'), + '#description' => $this->t('A field that would require a correct password to change.'), '#required' => TRUE, ); $form['current_pass'] = array( '#type' => 'password', - '#title' => t('Current password'), + '#title' => $this->t('Current password'), '#size' => 25, - '#description' => t('Enter your current password'), + '#description' => $this->t('Enter your current password'), ); $form['current_pass_required_values'] = array( '#type' => 'value', - '#value' => array('user_form_test_field' => t('Test field')), + '#value' => array('user_form_test_field' => $this->t('Test field')), ); $form['#validate'][] = 'user_validate_current_pass'; $form['submit'] = array( '#type' => 'submit', - '#value' => t('Test'), + '#value' => $this->t('Test'), ); return $form; } /** - * Implements \Drupal\Core\Form\FormInterface::validateForm(). - */ - public function validateForm(array &$form, array &$form_state) { - } - - /** - * Implements \Drupal\Core\Form\FormInterface::submitForm(). + * {@inheritdoc}. */ public function submitForm(array &$form, array &$form_state) { - drupal_set_message(t('The password has been validated and the form submitted successfully.')); + drupal_set_message($this->t('The password has been validated and the form submitted successfully.')); } }