class PasswordTest in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Render/Element/PasswordTest.php \Drupal\Tests\Core\Render\Element\PasswordTest
- 9 core/tests/Drupal/Tests/Core/Render/Element/PasswordTest.php \Drupal\Tests\Core\Render\Element\PasswordTest
@coversDefaultClass \Drupal\Core\Render\Element\Password @group Render
Hierarchy
- class \Drupal\Tests\Core\Render\Element\PasswordTest extends \Drupal\Tests\UnitTestCase
Expanded class hierarchy of PasswordTest
File
- core/
tests/ Drupal/ Tests/ Core/ Render/ Element/ PasswordTest.php, line 13
Namespace
Drupal\Tests\Core\Render\ElementView source
class PasswordTest extends UnitTestCase {
/**
* @covers ::valueCallback
*
* @dataProvider providerTestValueCallback
*/
public function testValueCallback($expected, $input) {
$element = [];
$form_state = $this
->prophesize(FormStateInterface::class)
->reveal();
$this
->assertSame($expected, Password::valueCallback($element, $input, $form_state));
}
/**
* Data provider for testValueCallback().
*/
public function providerTestValueCallback() {
$data = [];
$data[] = [
NULL,
FALSE,
];
$data[] = [
NULL,
NULL,
];
$data[] = [
'',
[
'test',
],
];
$data[] = [
'test',
'test',
];
$data[] = [
'123',
123,
];
return $data;
}
}