mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
8dd644d25d
Namespace all templates Move difflib and BBCodeParser2 to thirdparty Remove deprecated API marked for removal in 4.0
28 lines
770 B
PHP
28 lines
770 B
PHP
<?php
|
|
|
|
use SilverStripe\Dev\SapphireTest;
|
|
use SilverStripe\Forms\TextField;
|
|
use SilverStripe\Forms\EmailField;
|
|
use SilverStripe\Forms\CompositeField;
|
|
use SilverStripe\Forms\FieldGroup;
|
|
|
|
|
|
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());
|
|
}
|
|
|
|
}
|