2010-09-03 07:06:13 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests covering the form editor / builder and
|
|
|
|
* some of the user interface
|
|
|
|
*
|
|
|
|
* @package userforms
|
|
|
|
*/
|
|
|
|
|
|
|
|
class FieldEditorTest extends FunctionalTest {
|
|
|
|
|
|
|
|
static $fixture_file = 'userforms/tests/UserDefinedFormTest.yml';
|
|
|
|
|
2010-09-08 05:20:28 +02:00
|
|
|
protected $editor;
|
|
|
|
|
|
|
|
function setUp() {
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$form = $this->objFromFixture('UserDefinedForm', 'basic-form-page');
|
2010-09-03 07:06:13 +02:00
|
|
|
|
2010-09-08 05:20:28 +02:00
|
|
|
$controller = new FieldEditorTest_Controller($form);
|
|
|
|
|
|
|
|
$fields = $controller->Form()->Fields();
|
|
|
|
|
|
|
|
$this->editor = $fields->fieldByName('Fields');
|
2010-09-03 07:06:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function testSaveInto() {
|
2010-09-08 05:20:28 +02:00
|
|
|
$this->logInWithPermission('ADMIN');
|
2010-09-03 07:06:13 +02:00
|
|
|
|
2010-09-08 12:35:43 +02:00
|
|
|
// @todo
|
2010-09-03 07:06:13 +02:00
|
|
|
}
|
|
|
|
|
2010-09-08 05:20:28 +02:00
|
|
|
function testAddField() {
|
|
|
|
$this->logInWithPermission('ADMIN');
|
2010-09-03 07:06:13 +02:00
|
|
|
|
2010-09-08 05:20:28 +02:00
|
|
|
// Debug::show($this->editor->addfield());
|
2010-09-03 07:06:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class FieldEditorTest_Controller extends Controller {
|
|
|
|
|
2010-09-08 05:20:28 +02:00
|
|
|
function Form() {
|
|
|
|
return new Form($this, 'Form', new FieldSet(new FieldEditor('Fields')), new FieldSet());
|
|
|
|
}
|
2010-09-03 07:06:13 +02:00
|
|
|
}
|