From 37010da991b4e5d64a3dc9d3d1c9f2034a6e1d17 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Mon, 22 Aug 2016 17:01:56 +0100 Subject: [PATCH] Issue #2787655: Fix \Drupal\Tests\Core\Form\FormTestBase to not have multiple namespaces --- .../Drupal/Tests/Core/Form/FormTestBase.php | 37 ++---------------- .../Core/Form/fixtures/form_base_test.inc | 38 +++++++++++++++++++ 2 files changed, 42 insertions(+), 33 deletions(-) create mode 100644 core/tests/Drupal/Tests/Core/Form/fixtures/form_base_test.inc diff --git a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php index fd88ea22dea..078d30ed9c8 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php +++ b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php @@ -1,6 +1,6 @@ moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); $this->formCache = $this->getMock('Drupal\Core\Form\FormCacheInterface'); @@ -311,35 +314,3 @@ abstract class FormTestBase extends UnitTestCase { } } - -} - -namespace { - - function test_form_id() { - $form['test'] = array( - '#type' => 'textfield', - '#title' => 'Test', - ); - $form['options'] = array( - '#type' => 'radios', - '#options' => array( - 'foo' => 'foo', - 'bar' => 'bar', - ), - ); - $form['value'] = array( - '#type' => 'value', - '#value' => 'bananas', - ); - $form['actions'] = array( - '#type' => 'actions', - ); - $form['actions']['submit'] = array( - '#type' => 'submit', - '#value' => 'Submit', - ); - return $form; - } - -} diff --git a/core/tests/Drupal/Tests/Core/Form/fixtures/form_base_test.inc b/core/tests/Drupal/Tests/Core/Form/fixtures/form_base_test.inc new file mode 100644 index 00000000000..cd833946f33 --- /dev/null +++ b/core/tests/Drupal/Tests/Core/Form/fixtures/form_base_test.inc @@ -0,0 +1,38 @@ + 'textfield', + '#title' => 'Test', + ); + $form['options'] = array( + '#type' => 'radios', + '#options' => array( + 'foo' => 'foo', + 'bar' => 'bar', + ), + ); + $form['value'] = array( + '#type' => 'value', + '#value' => 'bananas', + ); + $form['actions'] = array( + '#type' => 'actions', + ); + $form['actions']['submit'] = array( + '#type' => 'submit', + '#value' => 'Submit', + ); + return $form; +}