[TASK] Renamed Textbox view helper unit test
authorKilian Hann <khann@fconnection.com>
Sat, 14 Apr 2012 10:52:16 +0000 (12:52 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 22 Jul 2012 22:25:50 +0000 (00:25 +0200)
As the textbox view helper has been renamed to textfield view helper,
the unit test follows the naming schema.

Change-Id: I416ebc080c519162fbe0d82bc69863af64e3a5e1
Fixes: #36011
Releases: 6.0
Reviewed-on: http://review.typo3.org/10455
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextboxViewHelperTest.php [deleted file]
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextfieldViewHelperTest.php [new file with mode: 0644]

diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextboxViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextboxViewHelperTest.php
deleted file mode 100644 (file)
index 727bd34..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-/*                                                                        *
- * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-require_once(dirname(__FILE__) . '/Fixtures/EmptySyntaxTreeNode.php');
-require_once(dirname(__FILE__) . '/Fixtures/Fixture_UserDomainClass.php');
-require_once(dirname(__FILE__) . '/FormFieldViewHelperBaseTestcase.php');
-
-/**
- * Test for the "Textfield" Form view helper
- *
- */
-class Tx_Fluid_Tests_Unit_ViewHelpers_Form_TextboxViewHelperTest extends Tx_Fluid_Tests_Unit_ViewHelpers_Form_FormFieldViewHelperBaseTestcase {
-
-       /**
-        * @var Tx_Fluid_ViewHelpers_Form_TextfieldViewHelper
-        */
-       protected $viewHelper;
-
-       public function setUp() {
-               parent::setUp();
-               $this->viewHelper = $this->getAccessibleMock('Tx_Fluid_ViewHelpers_Form_TextfieldViewHelper', array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
-               $this->arguments['name'] = '';
-               $this->injectDependenciesIntoViewHelper($this->viewHelper);
-               $this->viewHelper->initializeArguments();
-       }
-
-       /**
-        * @test
-        */
-       public function renderCorrectlySetsTagName() {
-               $mockTagBuilder = $this->getMock('Tx_Fluid_Core_ViewHelper_TagBuilder', array('setTagName'), array(), '', FALSE);
-               $mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
-
-               $this->viewHelper->initialize();
-               $this->viewHelper->render();
-       }
-
-       /**
-        * @test
-        */
-       public function renderCorrectlySetsTypeNameAndValueAttributes() {
-               $mockTagBuilder = $this->getMock('Tx_Fluid_Core_ViewHelper_TagBuilder', array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
-               $mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('type', 'text');
-               $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('name', 'NameOfTextfield');
-               $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextfield');
-               $mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('value', 'Current value');
-               $mockTagBuilder->expects($this->once())->method('render');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
-
-               $arguments = array(
-                       'name' => 'NameOfTextfield',
-                       'value' => 'Current value'
-               );
-               $this->viewHelper->setArguments($arguments);
-
-               $this->viewHelper->setViewHelperNode(new Tx_Fluid_ViewHelpers_Fixtures_EmptySyntaxTreeNode());
-               $this->viewHelper->initialize();
-               $this->viewHelper->render();
-       }
-
-       /**
-        * @test
-        */
-       public function renderCallsSetErrorClassAttribute() {
-               $this->viewHelper->expects($this->once())->method('setErrorClassAttribute');
-               $this->viewHelper->render();
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextfieldViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextfieldViewHelperTest.php
new file mode 100644 (file)
index 0000000..9bd7d72
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+
+/*                                                                        *
+ * This script is backported from the FLOW3 package "TYPO3.Fluid".        *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License, either version 3   *
+ *  of the License, or (at your option) any later version.                *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+require_once(dirname(__FILE__) . '/Fixtures/EmptySyntaxTreeNode.php');
+require_once(dirname(__FILE__) . '/Fixtures/Fixture_UserDomainClass.php');
+require_once(dirname(__FILE__) . '/FormFieldViewHelperBaseTestcase.php');
+
+/**
+ * Test for the "Textfield" Form view helper
+ *
+ */
+class Tx_Fluid_Tests_Unit_ViewHelpers_Form_TextfieldViewHelperTest extends Tx_Fluid_Tests_Unit_ViewHelpers_Form_FormFieldViewHelperBaseTestcase {
+
+       /**
+        * @var Tx_Fluid_ViewHelpers_Form_TextfieldViewHelper
+        */
+       protected $viewHelper;
+
+       public function setUp() {
+               parent::setUp();
+               $this->viewHelper = $this->getAccessibleMock('Tx_Fluid_ViewHelpers_Form_TextfieldViewHelper', array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
+               $this->arguments['name'] = '';
+               $this->injectDependenciesIntoViewHelper($this->viewHelper);
+               $this->viewHelper->initializeArguments();
+       }
+
+       /**
+        * @test
+        */
+       public function renderCorrectlySetsTagName() {
+               $mockTagBuilder = $this->getMock('Tx_Fluid_Core_ViewHelper_TagBuilder', array('setTagName'), array(), '', FALSE);
+               $mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
+               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+
+               $this->viewHelper->initialize();
+               $this->viewHelper->render();
+       }
+
+       /**
+        * @test
+        */
+       public function renderCorrectlySetsTypeNameAndValueAttributes() {
+               $mockTagBuilder = $this->getMock('Tx_Fluid_Core_ViewHelper_TagBuilder', array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
+               $mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('type', 'text');
+               $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('name', 'NameOfTextfield');
+               $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextfield');
+               $mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('value', 'Current value');
+               $mockTagBuilder->expects($this->once())->method('render');
+               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+
+               $arguments = array(
+                       'name' => 'NameOfTextfield',
+                       'value' => 'Current value'
+               );
+               $this->viewHelper->setArguments($arguments);
+
+               $this->viewHelper->setViewHelperNode(new Tx_Fluid_ViewHelpers_Fixtures_EmptySyntaxTreeNode());
+               $this->viewHelper->initialize();
+               $this->viewHelper->render();
+       }
+
+       /**
+        * @test
+        */
+       public function renderCallsSetErrorClassAttribute() {
+               $this->viewHelper->expects($this->once())->method('setErrorClassAttribute');
+               $this->viewHelper->render();
+       }
+}
+
+?>
\ No newline at end of file