mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
28 lines
583 B
PHP
28 lines
583 B
PHP
<?php
|
|
|
|
/**
|
|
* Various tests for the user defined forms.
|
|
* Does not test the user interface in the admin.
|
|
*
|
|
* @todo Add more comprehensive tests
|
|
* @package userforms
|
|
*/
|
|
|
|
class UserDefinedFormTest extends SapphireTest {
|
|
|
|
/**
|
|
* Basic Test creating all the editable form fields
|
|
*/
|
|
function testCreatingAllFields() {
|
|
$fields = ClassInfo::subclassesFor('EditableFormField');
|
|
foreach($fields as $field) {
|
|
$object = new $field();
|
|
$object->Name = "$field";
|
|
$object->Title = "$field";
|
|
$object->write();
|
|
|
|
$this->assertEquals($field, $object->Name);
|
|
}
|
|
}
|
|
}
|
|
?>
|