Neos\Flow\Tests\Unit\Validation\Validator\GenericObjectValidatorTest::dataProviderForValidator PHP 메소드

dataProviderForValidator() 공개 메소드

public dataProviderForValidator ( ) : array
리턴 array
    public function dataProviderForValidator()
    {
        $error1 = new Error\Error('error1', 1);
        $error2 = new Error\Error('error2', 2);
        $emptyResult1 = new Error\Result();
        $emptyResult2 = new Error\Result();
        $resultWithError1 = new Error\Result();
        $resultWithError1->addError($error1);
        $resultWithError2 = new Error\Result();
        $resultWithError2->addError($error2);
        $classNameForObjectWithPrivateProperties = 'B' . md5(uniqid(mt_rand(), true));
        eval('class ' . $classNameForObjectWithPrivateProperties . '{ protected $foo = \'foovalue\'; protected $bar = \'barvalue\'; }');
        $objectWithPrivateProperties = new $classNameForObjectWithPrivateProperties();
        return [[$objectWithPrivateProperties, $emptyResult1, $emptyResult2, []], [$objectWithPrivateProperties, $resultWithError1, $resultWithError2, ['foo' => [$error1], 'bar' => [$error2]]]];
    }