From 17ddfab87749b13e3bac249ed39442cea5a79beb Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Tue, 9 May 2017 14:09:48 +1200 Subject: [PATCH] Fix Test form factories use the new interface --- tests/php/Forms/FormFactoryTest/EditFactory.php | 8 ++++---- tests/php/Forms/FormFactoryTest/TestController.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/php/Forms/FormFactoryTest/EditFactory.php b/tests/php/Forms/FormFactoryTest/EditFactory.php index 09c1d8161..6ada58c98 100644 --- a/tests/php/Forms/FormFactoryTest/EditFactory.php +++ b/tests/php/Forms/FormFactoryTest/EditFactory.php @@ -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') diff --git a/tests/php/Forms/FormFactoryTest/TestController.php b/tests/php/Forms/FormFactoryTest/TestController.php index affe7928c..70f170c86 100644 --- a/tests/php/Forms/FormFactoryTest/TestController.php +++ b/tests/php/Forms/FormFactoryTest/TestController.php @@ -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]); }