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 {
|
|
|
|
|
2012-05-04 03:39:08 +02:00
|
|
|
public function Form() {
|
2012-04-22 21:17:42 +02:00
|
|
|
return new Form($this, 'Form', new FieldList(new FieldEditor('Fields')), new FieldList());
|
2010-09-08 05:20:28 +02:00
|
|
|
}
|
2010-09-03 07:06:13 +02:00
|
|
|
}
|