[TASK] Add unittest for shorthand for custom validators
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 2 Apr 2012 06:36:31 +0000 (08:36 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 6 Apr 2012 10:59:55 +0000 (12:59 +0200)
Port of unittest from FLOW3.

Resolves: #35514
Releases: 4.7, master
FLOW3 Issue: #33862

Change-Id: I4d0621e8d32d12959f647c183cf389cbe49e738d

typo3/sysext/extbase/Tests/Unit/Validation/ValidatorResolverTest.php

index 6351068..f05900f 100644 (file)
@@ -57,6 +57,17 @@ class Tx_Extbase_Tests_Unit_Validation_ValidatorResolverTest extends Tx_Extbase_
        /**
         * @test
         */
+       public function resolveValidatorObjectNameCanResolveShorthandValidatornames() {
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
+               eval('class Tx_Mypkg_Validation_Validator_MyValidator {}');
+               $validatorResolver = $this->getAccessibleMock('Tx_Extbase_Validation_ValidatorResolver', array('dummy'));
+               $validatorResolver->_set('objectManager', $mockObjectManager);
+               $this->assertSame('Tx_Mypkg_Validation_Validator_MyValidator', $validatorResolver->_call('resolveValidatorObjectName', 'Mypkg:My'));
+       }
+
+       /**
+        * @test
+        */
        public function resolveValidatorObjectNameCanResolveShortNamesOfBuiltInValidators() {
                $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                eval('class Tx_Extbase_Validation_Validator_FooValidator {}');