$this->
executeView($view);
$this->
assertTrue($view->argument
['null'
]->
validateArgument($this->account->
id()));
// Reset argument validation.
$view->argument
['null'
]->argument_validated = NULL;
// Fail for a valid numeric, but for a user that doesn't exist
$this->
assertFalse($view->argument
['null'
]->
validateArgument(32
));
$form =
[];
$form_state =
new FormState();
$view->argument
['null'
]->
buildOptionsForm($form,
$form_state);
$sanitized_id = ArgumentPluginBase::
encodeValidatorId('entity:user'
);
$this->
assertTrue($form['validate'
]['options'
][$sanitized_id]['roles'
]['#states'
]['visible'
][':input[name="options[validate][options][' .
$sanitized_id . '][restrict_roles]"]'
]['checked'
]);
} /**
* Tests the UserName argument validator.
*/
public function testArgumentValidateUserName() { $view = Views::
getView('test_view_argument_validate_username'
);
$this->
executeView($view);
$this->
assertTrue($view->argument
['null'
]->
validateArgument($this->account->
getAccountName()));