mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-26 20:45:47 +02:00
21 lines
590 B
PHP
21 lines
590 B
PHP
<?php
|
|
|
|
class FieldGroupTest extends SapphireTest {
|
|
|
|
public function testMessagesInsideNestedCompositeFields() {
|
|
$fieldGroup = new FieldGroup(
|
|
new CompositeField(
|
|
$textField = new TextField('TestField', 'Test Field'),
|
|
$emailField = new EmailField('TestEmailField', 'Test Email Field')
|
|
)
|
|
);
|
|
|
|
$textField->setError('Test error message', 'warning');
|
|
$emailField->setError('Test error message', 'error');
|
|
|
|
$this->assertEquals('Test error message, Test error message.', $fieldGroup->Message());
|
|
$this->assertEquals('warning. error', $fieldGroup->MessageType());
|
|
}
|
|
|
|
}
|