mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix Test form factories use the new interface
This commit is contained in:
parent
edcb220e4a
commit
17ddfab877
@ -2,7 +2,7 @@
|
||||
|
||||
namespace SilverStripe\Forms\Tests\FormFactoryTest;
|
||||
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\RequestHandler;
|
||||
use SilverStripe\Forms\DefaultFormFactory;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\FormAction;
|
||||
@ -12,13 +12,13 @@ use SilverStripe\Forms\TextField;
|
||||
/**
|
||||
* Test factory
|
||||
*/
|
||||
class EditFactory extends DefaultFormFactory
|
||||
class EditFormFactory extends DefaultFormFactory
|
||||
{
|
||||
private static $extensions = [
|
||||
ControllerExtension::class
|
||||
];
|
||||
|
||||
protected function getFormFields(Controller $controller, $name, $context = [])
|
||||
protected function getFormFields(RequestHandler $controller = null, $name, $context = [])
|
||||
{
|
||||
$fields = new FieldList(
|
||||
new HiddenField('ID'),
|
||||
@ -28,7 +28,7 @@ class EditFactory extends DefaultFormFactory
|
||||
return $fields;
|
||||
}
|
||||
|
||||
protected function getFormActions(Controller $controller, $name, $context = [])
|
||||
protected function getFormActions(RequestHandler $controller = null, $name, $context = [])
|
||||
{
|
||||
$actions = new FieldList(
|
||||
new FormAction('save', 'Save')
|
||||
|
@ -29,7 +29,7 @@ class TestController extends Controller
|
||||
{
|
||||
// Simple example; Just get the first draft record
|
||||
$record = $this->getRecord();
|
||||
$factory = new EditFactory();
|
||||
$factory = new EditFormFactory();
|
||||
return $factory->getForm($this, 'Form', ['Record' => $record]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user