[CLEANUP] Drop incomplete tests
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 2 Apr 2013 19:56:05 +0000 (21:56 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 2 Apr 2013 20:00:37 +0000 (22:00 +0200)
Resolves: #46871
Releases: 6.1
Change-Id: Ic9aabd83de82bb00be332956e4d5d9802d9a8952
Reviewed-on: https://review.typo3.org/19523
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormFieldViewHelperTest.php

index 5c8e3f7..87f5d50 100644 (file)
@@ -239,149 +239,6 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
        /**
         * @test
         */
-       public function getErrorsForPropertyReturnsErrorsFromRequestIfPropertyIsSet() {
-               $this->markTestIncomplete('Sebastian -- TODO after T3BOARD');
-
-               $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
-               $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $formViewHelper->expects($this->once())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
-               $mockArguments = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Arguments', array(), array(), '', FALSE);
-               $mockArguments->expects($this->once())->method('offsetGet')->with('property')->will($this->returnValue('bar'));
-               $formViewHelper->_set('arguments', $mockArguments);
-               $this->viewHelperVariableContainer->expects($this->any())->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName')->will($this->returnValue('foo'));
-
-               $mockArgumentError = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ArgumentError', array(), array('foo'));
-               $mockArgumentError->expects($this->once())->method('getPropertyName')->will($this->returnValue('foo'));
-               $mockPropertyError = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\PropertyError', array(), array('bar'));
-               $mockPropertyError->expects($this->once())->method('getPropertyName')->will($this->returnValue('bar'));
-               $mockError = $this->getMock('TYPO3\\CMS\\Extbase\\Error\\Error', array(), array(), '', FALSE);
-               $mockPropertyError->expects($this->once())->method('getErrors')->will($this->returnValue(array($mockError)));
-               $mockArgumentError->expects($this->once())->method('getErrors')->will($this->returnValue(array($mockPropertyError)));
-               $this->request->expects($this->once())->method('getErrors')->will($this->returnValue(array($mockArgumentError)));
-
-               $errors = $formViewHelper->_call('getErrorsForProperty');
-               $this->assertEquals(array($mockError), $errors);
-       }
-
-       /**
-        * @test
-        */
-       public function getErrorsForPropertyReturnsEmptyArrayIfPropertyIsNotSet() {
-               $this->markTestIncomplete('Sebastian -- TODO after T3BOARD');
-               $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('hasArgument'), array(), '', FALSE);
-               $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $mockArguments = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Arguments', array(), array(), '', FALSE);
-               $mockArguments->expects($this->once())->method('hasArgument')->with('property')->will($this->returnValue(FALSE));
-               $formViewHelper->_set('arguments', $mockArguments);
-
-               $errors = $formViewHelper->_call('getErrorsForProperty');
-               $this->assertEquals(array(), $errors);
-       }
-
-
-       /**
-        * @test
-        */
-       public function setErrorClassAttributeDoesNotSetClassAttributeIfNoErrorOccured() {
-               $this->markTestIncomplete('Sebastian -- TODO after T3BOARD');
-               $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('hasArgument', 'getErrorsForProperty'), array(), '', FALSE);
-               $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $mockArguments = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Arguments', array(), array(), '', FALSE);
-               $mockArguments->expects($this->once())->method('hasArgument')->with('class')->will($this->returnValue(FALSE));
-               $formViewHelper->_set('arguments', $mockArguments);
-
-               $this->tagBuilder->expects($this->never())->method('addAttribute');
-
-               $formViewHelper->_call('setErrorClassAttribute');
-       }
-
-       /**
-        * @test
-        */
-       public function setErrorClassAttributeSetsErrorClassIfAnErrorOccured() {
-               $this->markTestIncomplete('Sebastian -- TODO after T3BOARD');
-               $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('hasArgument', 'getErrorsForProperty'), array(), '', FALSE);
-               $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $mockArguments = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Arguments', array(), array(), '', FALSE);
-               $mockArguments->expects($this->at(0))->method('hasArgument')->with('class')->will($this->returnValue(FALSE));
-               $mockArguments->expects($this->at(1))->method('hasArgument')->with('errorClass')->will($this->returnValue(FALSE));
-               $formViewHelper->_set('arguments', $mockArguments);
-
-               $mockError = $this->getMock('TYPO3\\CMS\\Extbase\\Error\\Error', array(), array(), '', FALSE);
-               $formViewHelper->expects($this->once())->method('getErrorsForProperty')->will($this->returnValue(array($mockError)));
-
-               $this->tagBuilder->expects($this->once())->method('addAttribute')->with('class', 'error');
-
-               $formViewHelper->_call('setErrorClassAttribute');
-       }
-
-       /**
-        * @test
-        */
-       public function setErrorClassAttributeAppendsErrorClassToExistingClassesIfAnErrorOccured() {
-               $this->markTestIncomplete('Sebastian -- TODO after T3BOARD');
-               $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('hasArgument', 'getErrorsForProperty'), array(), '', FALSE);
-               $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $mockArguments = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Arguments', array(), array(), '', FALSE);
-               $mockArguments->expects($this->at(0))->method('hasArgument')->with('class')->will($this->returnValue(TRUE));
-               $mockArguments->expects($this->at(1))->method('offsetGet')->with('class')->will($this->returnValue('default classes'));
-               $mockArguments->expects($this->at(2))->method('hasArgument')->with('errorClass')->will($this->returnValue(FALSE));
-               $formViewHelper->_set('arguments', $mockArguments);
-
-               $mockError = $this->getMock('TYPO3\\CMS\\Extbase\\Error\\Error', array(), array(), '', FALSE);
-               $formViewHelper->expects($this->once())->method('getErrorsForProperty')->will($this->returnValue(array($mockError)));
-
-               $this->tagBuilder->expects($this->once())->method('addAttribute')->with('class', 'default classes error');
-
-               $formViewHelper->_call('setErrorClassAttribute');
-       }
-
-       /**
-        * @test
-        */
-       public function setErrorClassAttributeSetsCustomErrorClassIfAnErrorOccured() {
-               $this->markTestIncomplete('Sebastian -- TODO after T3BOARD');
-               $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('hasArgument', 'getErrorsForProperty'), array(), '', FALSE);
-               $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $mockArguments = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Arguments', array(), array(), '', FALSE);
-               $mockArguments->expects($this->at(0))->method('hasArgument')->with('class')->will($this->returnValue(FALSE));
-               $mockArguments->expects($this->at(1))->method('hasArgument')->with('errorClass')->will($this->returnValue(TRUE));
-               $mockArguments->expects($this->at(2))->method('offsetGet')->with('errorClass')->will($this->returnValue('custom-error-class'));
-               $formViewHelper->_set('arguments', $mockArguments);
-
-               $mockError = $this->getMock('TYPO3\\CMS\\Extbase\\Error\\Error', array(), array(), '', FALSE);
-               $formViewHelper->expects($this->once())->method('getErrorsForProperty')->will($this->returnValue(array($mockError)));
-
-               $this->tagBuilder->expects($this->once())->method('addAttribute')->with('class', 'custom-error-class');
-
-               $formViewHelper->_call('setErrorClassAttribute');
-       }
-
-       /**
-        * @test
-        */
-       public function setErrorClassAttributeAppendsCustomErrorClassIfAnErrorOccured() {
-               $this->markTestIncomplete('Sebastian -- TODO after T3BOARD');
-               $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('hasArgument', 'getErrorsForProperty'), array(), '', FALSE);
-               $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $mockArguments = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Arguments', array(), array(), '', FALSE);
-               $mockArguments->expects($this->at(0))->method('hasArgument')->with('class')->will($this->returnValue(TRUE));
-               $mockArguments->expects($this->at(1))->method('offsetGet')->with('class')->will($this->returnValue('default classes'));
-               $mockArguments->expects($this->at(2))->method('hasArgument')->with('errorClass')->will($this->returnValue(TRUE));
-               $mockArguments->expects($this->at(3))->method('offsetGet')->with('errorClass')->will($this->returnValue('custom-error-class'));
-               $formViewHelper->_set('arguments', $mockArguments);
-
-               $mockError = $this->getMock('TYPO3\\CMS\\Extbase\\Error\\Error', array(), array(), '', FALSE);
-               $formViewHelper->expects($this->once())->method('getErrorsForProperty')->will($this->returnValue(array($mockError)));
-
-               $this->tagBuilder->expects($this->once())->method('addAttribute')->with('class', 'default classes custom-error-class');
-
-               $formViewHelper->_call('setErrorClassAttribute');
-       }
-
-       /**
-        * @test
-        */
        public function addAdditionalIdentityPropertiesIfNeededDoesNotCreateAnythingIfPropertyIsWithoutDot() {
                $formFieldViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('renderHiddenIdentityField'), array(), '', FALSE);
                $this->injectDependenciesIntoViewHelper($formFieldViewHelper);