TYPO3 API  SVNRelease
ValidatorResolverTest.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
00006 *  All rights reserved
00007 *
00008 *  This class is a backport of the corresponding class of FLOW3.
00009 *  All credits go to the v5 team.
00010 *
00011 *  This script is part of the TYPO3 project. The TYPO3 project is
00012 *  free software; you can redistribute it and/or modify
00013 *  it under the terms of the GNU General Public License as published by
00014 *  the Free Software Foundation; either version 2 of the License, or
00015 *  (at your option) any later version.
00016 *
00017 *  The GNU General Public License can be found at
00018 *  http://www.gnu.org/copyleft/gpl.html.
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00027 
00028 /**
00029  * Testcase for the validator resolver
00030  *
00031  * @package Extbase
00032  * @subpackage extbase
00033  * @version $Id: ValidatorResolver_testcase.php 2708 2010-11-10 18:56:01Z bwaidelich $
00034  */
00035 class Tx_Extbase_Tests_Unit_Validation_ValidatorResolverTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
00036 
00037     /**
00038      * @test
00039      */
00040     public function resolveValidatorObjectNameReturnsFalseIfValidatorCantBeResolved() {
00041         $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
00042         $validatorResolver = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_Validation_ValidatorResolver'), array('dummy'));
00043         $validatorResolver->_set('objectManager', $objectManager);
00044         $this->assertSame(FALSE, $validatorResolver->_call('resolveValidatorObjectName', 'Foo'));
00045     }
00046 
00047     /**
00048      * @test
00049      */
00050     public function resolveValidatorObjectNameReturnsTheGivenArgumentIfAnObjectOfThatNameIsRegistered() {
00051         $validatorName = uniqid('FooValidator_') . 'Validator';
00052         eval('class ' . $validatorName . ' {}');
00053         $validatorResolver = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_Validation_ValidatorResolver'), array('dummy'));
00054         $this->assertSame($validatorName, $validatorResolver->_call('resolveValidatorObjectName', $validatorName));
00055     }
00056 
00057     /**
00058      * @test
00059      */
00060     public function resolveValidatorObjectNameCanResolveShortNamesOfBuiltInValidators() {
00061         $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
00062         eval('class Tx_Extbase_Validation_Validator_FooValidator {}');
00063         $validatorResolver = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_Validation_ValidatorResolver'), array('dummy'));
00064         $validatorResolver->_set('objectManager', $mockObjectManager);
00065         $this->assertSame('Tx_Extbase_Validation_Validator_FooValidator', $validatorResolver->_call('resolveValidatorObjectName', 'Foo'));
00066     }
00067 
00068     /**
00069      * @test
00070      */
00071     public function createValidatorResolvesAndReturnsAValidatorAndPassesTheGivenOptions() {
00072         $className = uniqid('Test');
00073         $mockValidator = $this->getMock('Tx_Extbase_Validation_Validator_ObjectValidatorInterface', array(), array(), $className);
00074         $mockValidator->expects($this->once())->method('setOptions')->with(array('foo' => 'bar'));
00075 
00076         $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
00077         $mockObjectManager->expects($this->any())->method('get')->with($className)->will($this->returnValue($mockValidator));
00078 
00079         $validatorResolver = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_Validation_ValidatorResolver'),array('resolveValidatorObjectName'));
00080         $validatorResolver->_set('objectManager', $mockObjectManager);
00081         $validatorResolver->expects($this->once())->method('resolveValidatorObjectName')->with($className)->will($this->returnValue($className));
00082         $validator = $validatorResolver->createValidator($className, array('foo' => 'bar'));
00083         $this->assertSame($mockValidator, $validator);
00084     }
00085 
00086     /**
00087      * @test
00088      */
00089     public function createValidatorReturnsNullIfAValidatorCouldNotBeResolved() {
00090         $validatorResolver = $this->getMock('Tx_Extbase_Validation_ValidatorResolver',array('resolveValidatorObjectName'), array(), '', FALSE);
00091         $validatorResolver->expects($this->once())->method('resolveValidatorObjectName')->with('Foo')->will($this->returnValue(FALSE));
00092         $validator = $validatorResolver->createValidator('Foo', array('foo' => 'bar'));
00093         $this->assertNull($validator);
00094     }
00095 
00096     /**
00097      * @test
00098      */
00099     public function getBaseValidatorCachesTheResultOfTheBuildBaseValidatorChainCalls() {
00100         $mockConjunctionValidator = $this->getMock('Tx_Extbase_Validation_Validator_ConjunctionValidator', array(), array(), '', FALSE);
00101 
00102         $validatorResolver = $this->getMock('Tx_Extbase_Validation_ValidatorResolver', array('buildBaseValidatorConjunction'), array(), '', FALSE);
00103         $validatorResolver->expects($this->once())->method('buildBaseValidatorConjunction')->with('Tx_Virtual_Foo')->will($this->returnValue($mockConjunctionValidator));
00104 
00105         $result = $validatorResolver->getBaseValidatorConjunction('Tx_Virtual_Foo');
00106         $this->assertSame($mockConjunctionValidator, $result, '#1');
00107 
00108         $result = $validatorResolver->getBaseValidatorConjunction('Tx_Virtual_Foo');
00109         $this->assertSame($mockConjunctionValidator, $result, '#2');
00110     }
00111 
00112     /**
00113      * @test
00114      * @author Sebastian Kurfürst <sbastian@typo3.org>
00115      */
00116     public function buildMethodArgumentsValidatorConjunctionsReturnsEmptyArrayIfMethodHasNoArguments() {
00117         $mockController = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_MVC_Controller_ActionController'), array('fooAction'), array(), '', FALSE);
00118 
00119         $methodTagsValues = array();
00120         $methodParameters = array();
00121 
00122         $mockReflectionService = $this->getMock('Tx_Extbase_Reflection_Service', array(), array(), '', FALSE);
00123         $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodTagsValues));
00124         $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters));
00125 
00126         $validatorResolver = $this->getMock('Tx_Extbase_Validation_ValidatorResolver', array('createValidator'));
00127         $validatorResolver->injectReflectionService($mockReflectionService);
00128 
00129         $result = $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockController), 'fooAction');
00130         $this->assertSame(array(), $result);
00131     }
00132 
00133     /**
00134      * @test
00135      * @author Robert Lemke <robert@typo3.org>
00136      * @author Bastian Waidelich <bastian@typo3.org>
00137      */
00138     public function buildMethodArgumentsValidatorConjunctionsBuildsAConjunctionFromValidateAnnotationsOfTheSpecifiedMethod() {
00139         $mockObject = $this->getMock('stdClass', array('fooMethod'), array(), '', FALSE);
00140 
00141         $methodParameters = array(
00142             'arg1' => array(
00143                 'type' => 'string'
00144             ),
00145             'arg2' => array(
00146                 'type' => 'array'
00147             )
00148 
00149         );
00150         $methodTagsValues = array(
00151             'param' => array(
00152                 'string $arg1',
00153                 'array $arg2',
00154             ),
00155             'validate' => array(
00156                 '$arg1 Foo(bar = baz), Bar',
00157                 '$arg2 F3_TestPackage_Quux'
00158             )
00159         );
00160 
00161         $mockReflectionService = $this->getMock('Tx_Extbase_Reflection_Service', array(), array(), '', FALSE);
00162         $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockObject), 'fooAction')->will($this->returnValue($methodTagsValues));
00163         $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockObject), 'fooAction')->will($this->returnValue($methodParameters));
00164 
00165         $mockStringValidator = $this->getMock('Tx_Extbase_Validation_Validator_ValidatorInterface', array(), array(), '', FALSE);
00166         $mockArrayValidator = $this->getMock('Tx_Extbase_Validation_Validator_ValidatorInterface', array(), array(), '', FALSE);
00167         $mockFooValidator = $this->getMock('Tx_Extbase_Validation_Validator_ValidatorInterface', array(), array(), '', FALSE);
00168         $mockBarValidator = $this->getMock('Tx_Extbase_Validation_Validator_ValidatorInterface', array(), array(), '', FALSE);
00169         $mockQuuxValidator = $this->getMock('Tx_Extbase_Validation_Validator_ValidatorInterface', array(), array(), '', FALSE);
00170 
00171         $conjunction1 = $this->getMock('Tx_Extbase_Validation_Validator_ConjunctionValidator', array(), array(), '', FALSE);
00172         $conjunction1->expects($this->at(0))->method('addValidator')->with($mockStringValidator);
00173         $conjunction1->expects($this->at(1))->method('addValidator')->with($mockFooValidator);
00174         $conjunction1->expects($this->at(2))->method('addValidator')->with($mockBarValidator);
00175 
00176         $conjunction2 = $this->getMock('Tx_Extbase_Validation_Validator_ConjunctionValidator', array(), array(), '', FALSE);
00177         $conjunction2->expects($this->at(0))->method('addValidator')->with($mockArrayValidator);
00178         $conjunction2->expects($this->at(1))->method('addValidator')->with($mockQuuxValidator);
00179 
00180         $mockObjectFactory = $this->getMock('Tx_Extbase_Object_FactoryInterface');
00181 
00182         $mockArguments = new Tx_Extbase_MVC_Controller_Arguments();
00183         $mockArguments->addArgument(new Tx_Extbase_MVC_Controller_Argument('arg1', 'dummyValue'));
00184         $mockArguments->addArgument(new Tx_Extbase_MVC_Controller_Argument('arg2', 'dummyValue'));
00185 
00186         $validatorResolver = $this->getMock('Tx_Extbase_Validation_ValidatorResolver', array('createValidator'));
00187         $validatorResolver->expects($this->at(0))->method('createValidator')->with('Conjunction')->will($this->returnValue($conjunction1));
00188         $validatorResolver->expects($this->at(1))->method('createValidator')->with('string')->will($this->returnValue($mockStringValidator));
00189         $validatorResolver->expects($this->at(2))->method('createValidator')->with('Conjunction')->will($this->returnValue($conjunction2));
00190         $validatorResolver->expects($this->at(3))->method('createValidator')->with('array')->will($this->returnValue($mockArrayValidator));
00191         $validatorResolver->expects($this->at(4))->method('createValidator')->with('Foo', array('bar' => 'baz'))->will($this->returnValue($mockFooValidator));
00192         $validatorResolver->expects($this->at(5))->method('createValidator')->with('Bar')->will($this->returnValue($mockBarValidator));
00193         $validatorResolver->expects($this->at(6))->method('createValidator')->with('F3_TestPackage_Quux')->will($this->returnValue($mockQuuxValidator));
00194 
00195         $validatorResolver->injectReflectionService($mockReflectionService);
00196 
00197         $result = $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockObject), 'fooAction');
00198         $this->assertEquals(array('arg1' => $conjunction1, 'arg2' => $conjunction2), $result);
00199     }
00200 
00201     /**
00202      * @test
00203      * @author Sebastian Kurfürst <sbastian@typo3.org>
00204      * @expectedException Tx_Extbase_Validation_Exception_InvalidValidationConfiguration
00205      */
00206     public function buildMethodArgumentsValidatorConjunctionsThrowsExceptionIfValidationAnnotationForNonExistingArgumentExists() {
00207         $mockObject = $this->getMock('stdClass', array('fooMethod'), array(), '', FALSE);
00208 
00209         $methodParameters = array(
00210             'arg1' => array(
00211                 'type' => 'string'
00212             )
00213         );
00214         $methodTagsValues = array(
00215             'param' => array(
00216                 'string $arg1',
00217             ),
00218             'validate' => array(
00219                 '$arg2 F3_TestPackage_Quux'
00220             )
00221         );
00222 
00223         $mockReflectionService = $this->getMock('Tx_Extbase_Reflection_Service', array(), array(), '', FALSE);
00224         $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockObject), 'fooAction')->will($this->returnValue($methodTagsValues));
00225         $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockObject), 'fooAction')->will($this->returnValue($methodParameters));
00226 
00227         $mockStringValidator = $this->getMock('Tx_Extbase_Validation_Validator_ValidatorInterface', array(), array(), '', FALSE);
00228         $mockQuuxValidator = $this->getMock('Tx_Extbase_Validation_Validator_ValidatorInterface', array(), array(), '', FALSE);
00229         $conjunction1 = $this->getMock('Tx_Extbase_Validation_Validator_ConjunctionValidator', array(), array(), '', FALSE);
00230         $conjunction1->expects($this->at(0))->method('addValidator')->with($mockStringValidator);
00231 
00232         $validatorResolver = $this->getMock('Tx_Extbase_Validation_ValidatorResolver', array('createValidator'));
00233         $validatorResolver->expects($this->at(0))->method('createValidator')->with('Conjunction')->will($this->returnValue($conjunction1));
00234         $validatorResolver->expects($this->at(1))->method('createValidator')->with('string')->will($this->returnValue($mockStringValidator));
00235         $validatorResolver->expects($this->at(2))->method('createValidator')->with('F3_TestPackage_Quux')->will($this->returnValue($mockQuuxValidator));
00236 
00237         $validatorResolver->injectReflectionService($mockReflectionService);
00238 
00239         $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockObject), 'fooAction');
00240     }
00241 
00242     /**
00243      * @test
00244      * @author Robert Lemke <robert@typo3.org>
00245      * @author Christopher Hlubek <hlubek@networkteam.com>
00246      */
00247     public function buildBaseValidatorConjunctionAddsValidatorsDefinedByAnnotationsInTheClassToTheReturnedConjunction() {
00248         $mockObject = $this->getMock('stdClass');
00249         $className = get_class($mockObject);
00250 
00251         $propertyTagsValues = array(
00252             'foo' => array(
00253                 'var' => array('string'),
00254                 'validate' => array(
00255                     'Foo(bar = baz), Bar',
00256                     'Baz'
00257                 )
00258             ),
00259             'bar' => array(
00260                 'var' => array('integer'),
00261                 'validate' => array(
00262                     'F3_TestPackage_Quux'
00263                 )
00264             )
00265         );
00266 
00267         $mockReflectionService = $this->getMock('Tx_Extbase_Reflection_Service', array(), array(), '', FALSE);
00268         $mockReflectionService->expects($this->at(0))->method('getClassPropertyNames')->with($className)->will($this->returnValue(array('foo', 'bar')));
00269         $mockReflectionService->expects($this->at(1))->method('getPropertyTagsValues')->with($className, 'foo')->will($this->returnValue($propertyTagsValues['foo']));
00270         $mockReflectionService->expects($this->at(2))->method('getPropertyTagsValues')->with($className, 'bar')->will($this->returnValue($propertyTagsValues['bar']));
00271 
00272         $mockObjectValidator = $this->getMock('Tx_Extbase_Validation_Validator_GenericObjectValidator', array(), array(), '', FALSE);
00273 
00274         $mockConjunctionValidator = $this->getMock('Tx_Extbase_Validation_Validator_ConjunctionValidator', array(), array(), '', FALSE);
00275         $mockConjunctionValidator->expects($this->once())->method('addValidator')->with($mockObjectValidator);
00276 
00277         $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface', array(), array(), '', FALSE);
00278         $mockObjectManager->expects($this->at(0))->method('get')->with('Tx_Extbase_Validation_Validator_ConjunctionValidator')->will($this->returnValue($mockConjunctionValidator));
00279 
00280         $validatorResolver = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_Validation_ValidatorResolver'), array('resolveValidatorObjectName', 'createValidator'));
00281         $validatorResolver->injectReflectionService($mockReflectionService);
00282         $validatorResolver->injectObjectManager($mockObjectManager);
00283 
00284         $validatorResolver->expects($this->at(0))->method('createValidator')->with('GenericObject')->will($this->returnValue($mockObjectValidator));
00285         $validatorResolver->expects($this->at(1))->method('createValidator')->with('Foo', array('bar' => 'baz'))->will($this->returnValue($mockObjectValidator));
00286         $validatorResolver->expects($this->at(2))->method('createValidator')->with('Bar')->will($this->returnValue($mockObjectValidator));
00287         $validatorResolver->expects($this->at(3))->method('createValidator')->with('Baz')->will($this->returnValue($mockObjectValidator));
00288         $validatorResolver->expects($this->at(4))->method('createValidator')->with('F3_TestPackage_Quux')->will($this->returnValue($mockObjectValidator));
00289         $validatorResolver->expects($this->at(5))->method('createValidator')->with($className . 'Validator')->will($this->returnValue(NULL));
00290 
00291         $result = $validatorResolver->_call('buildBaseValidatorConjunction', $className);
00292         $this->assertSame($mockConjunctionValidator, $result);
00293     }
00294 
00295     /**
00296      * @test
00297      * @author Bastian Waidelich <bastian@typo3.org>
00298      */
00299     public function resolveValidatorObjectNameCallsUnifyDataType() {
00300         $mockValidatorResolver = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_Validation_ValidatorResolver'), array('unifyDataType'));
00301         $mockValidatorResolver->expects($this->once())->method('unifyDataType')->with('someDataType');
00302         $mockValidatorResolver->_call('resolveValidatorObjectName', 'someDataType');
00303     }
00304 
00305     /**
00306      * @test
00307      * @author Bastian Waidelich <bastian@typo3.org>
00308      */
00309     public function unifyDataTypeCorrectlyRenamesPHPDataTypes() {
00310         $mockValidatorResolver = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_Validation_ValidatorResolver'), array('dummy'));
00311         $this->assertEquals('Integer', $mockValidatorResolver->_call('unifyDataType', 'integer'));
00312         $this->assertEquals('Integer', $mockValidatorResolver->_call('unifyDataType', 'int'));
00313         $this->assertEquals('String', $mockValidatorResolver->_call('unifyDataType', 'string'));
00314         $this->assertEquals('Array', $mockValidatorResolver->_call('unifyDataType', 'array'));
00315         $this->assertEquals('Float', $mockValidatorResolver->_call('unifyDataType', 'float'));
00316         $this->assertEquals('Float', $mockValidatorResolver->_call('unifyDataType', 'double'));
00317         $this->assertEquals('Boolean', $mockValidatorResolver->_call('unifyDataType', 'boolean'));
00318         $this->assertEquals('Boolean', $mockValidatorResolver->_call('unifyDataType', 'bool'));
00319         $this->assertEquals('Boolean', $mockValidatorResolver->_call('unifyDataType', 'bool'));
00320         $this->assertEquals('Number', $mockValidatorResolver->_call('unifyDataType', 'number'));
00321         $this->assertEquals('Number', $mockValidatorResolver->_call('unifyDataType', 'numeric'));
00322     }
00323 
00324     /**
00325      * @test
00326      * @author Bastian Waidelich <bastian@typo3.org>
00327      */
00328     public function unifyDataTypeRenamesMixedToRaw() {
00329         $mockValidator = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_Validation_ValidatorResolver'), array('dummy'));
00330         $this->assertEquals('Raw', $mockValidator->_call('unifyDataType', 'mixed'));
00331     }
00332 
00333     /**
00334      * dataProvider for parseValidatorAnnotationCanParseAnnotations
00335      * @author Karsten Dambekalns <karsten@typo3.org>
00336      * @author Christopher Hlubek <hlubek@networkteam.com>
00337      */
00338     public function validatorAnnotations() {
00339         return array(
00340             array('$var Bar', array('argumentName' => 'var', 'validators' => array(
00341                         array('validatorName' => 'Bar', 'validatorOptions' => array())))),
00342             array('$var Bar, Foo', array('argumentName' => 'var', 'validators' => array(
00343                         array('validatorName' => 'Bar', 'validatorOptions' => array()),
00344                         array('validatorName' => 'Foo', 'validatorOptions' => array())
00345                         ))),
00346             array('$var Baz (Foo=Bar)', array('argumentName' => 'var', 'validators' => array(
00347                         array('validatorName' => 'Baz', 'validatorOptions' => array('Foo' => 'Bar'))))),
00348             array('$var Buzz (Foo="B=a, r", Baz=1)', array('argumentName' => 'var', 'validators' => array(
00349                         array('validatorName' => 'Buzz', 'validatorOptions' => array('Foo' => 'B=a, r', 'Baz' => '1'))))),
00350             array('$var Foo(Baz=1, Bar=Quux)', array('argumentName' => 'var', 'validators' => array(
00351                         array('validatorName' => 'Foo', 'validatorOptions' => array('Baz' => '1', 'Bar' => 'Quux'))))),
00352             array('$var Pax, Foo(Baz = \'1\', Bar = Quux)', array('argumentName' => 'var', 'validators' => array(
00353                             array('validatorName' => 'Pax', 'validatorOptions' => array()),
00354                             array('validatorName' => 'Foo', 'validatorOptions' => array('Baz' => '1', 'Bar' => 'Quux'))
00355                         ))),
00356             array('$var Reg (P="[at]*(h|g)"), Quux', array('argumentName' => 'var', 'validators' => array(
00357                             array('validatorName' => 'Reg', 'validatorOptions' => array('P' => '[at]*(h|g)')),
00358                             array('validatorName' => 'Quux', 'validatorOptions' => array())
00359                         ))),
00360             array('$var Baz (Foo="B\"ar")', array('argumentName' => 'var', 'validators' => array(
00361                         array('validatorName' => 'Baz', 'validatorOptions' => array('Foo' => 'B"ar'))))),
00362             array('$var F3_TestPackage_Quux', array('argumentName' => 'var', 'validators' => array(
00363                         array('validatorName' => 'F3_TestPackage_Quux', 'validatorOptions' => array())))),
00364             array('$var Baz(Foo="5"), Bar(Quux="123")', array('argumentName' => 'var', 'validators' => array(
00365                             array('validatorName' => 'Baz', 'validatorOptions' => array('Foo' => '5')),
00366                             array('validatorName' => 'Bar', 'validatorOptions' => array('Quux' => '123'))))),
00367             array('$var Baz(Foo="2"), Bar(Quux=123, Pax="a weird \"string\" with *freaky* \\stuff")', array('argumentName' => 'var', 'validators' => array(
00368                             array('validatorName' => 'Baz', 'validatorOptions' => array('Foo' => '2')),
00369                             array('validatorName' => 'Bar', 'validatorOptions' => array('Quux' => '123', 'Pax' => 'a weird "string" with *freaky* \\stuff'))))),
00370         );
00371     }
00372 
00373     /**
00374      *
00375      * @test
00376      * @dataProvider validatorAnnotations
00377      * @author Karsten Dambekalns <karsten@typo3.org>
00378      */
00379     public function parseValidatorAnnotationCanParseAnnotations($annotation, $expectedResult) {
00380         $mockValidatorResolver = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_Validation_ValidatorResolver'), array('dummy'));
00381         $result = $mockValidatorResolver->_call('parseValidatorAnnotation', $annotation);
00382 
00383         $this->assertEquals($result, $expectedResult);
00384     }
00385 
00386 }
00387 
00388 ?>