'filter_test' => 'Test format',
'plain_text' => 'Plain text',
];
$available_values =
$data->
getPossibleValues();
$this->
assertEquals(array_keys($expected_available_options),
$available_values);
$available_options =
$data->
getPossibleOptions();
$this->
assertEquals($expected_available_options,
$available_options);
$allowed_values =
$data->
getSettableValues($user);
$this->
assertEquals(['plain_text'
],
$allowed_values);
$allowed_options =
$data->
getSettableOptions($user);
$this->
assertEquals(['plain_text' => 'Plain text'
],
$allowed_options);
$data->
setValue('foo'
);
$violations =
$data->
validate();
$this->
assertFilterFormatViolation($violations, 'foo'
);
// Make sure the information provided by a violation is correct.
$violation =
$violations[0
];
$this->
assertEquals($data,
$violation->
getRoot(), 'Violation root is filter format.'
);
$this->
assertEquals('',
$violation->
getPropertyPath(), 'Violation property path is correct.'
);
$this->
assertEquals('foo',
$violation->
getInvalidValue(), 'Violation contains invalid value.'
);