#                                                                        #
# Configuration for the Flow Framework                                   #
#                                                                        #
# This file contains additions to the base configuration for the         #
# Flow Framework when it runs in Testing context.                        #
#                                                                        #
# Don't modify this file - instead put your own additions into the       #
# global Configuration directory and its sub directories.                #
#                                                                        #

Neos:

  Flow:

    core:
      subRequestEnvironmentVariables:
        XDEBUG_CONFIG: 'idekey=FLOW_SUBREQUEST remote_port=9001'

    error:
      exceptionHandler:
        className: 'Neos\Flow\Error\DebugExceptionHandler'
      errorHandler:
        exceptionalErrors: ['%E_USER_ERROR%', '%E_RECOVERABLE_ERROR%', '%E_WARNING%', '%E_NOTICE%', '%E_USER_WARNING%', '%E_USER_NOTICE%']

    log:
      psr3:
        'Neos\Flow\Log\PsrLoggerFactory':
          systemLogger:
            default:
              options:
                logFileURL: '%FLOW_PATH_DATA%Logs/System_Testing.log'
                severityThreshold: '%LOG_DEBUG%'

          securityLogger:
            default:
              options:
                logFileURL: '%FLOW_PATH_DATA%Logs/Security_Testing.log'
                severityThreshold: '%LOG_DEBUG%'

          sqlLogger:
            default:
              options:
                logFileURL: '%FLOW_PATH_DATA%Logs/Query_Testing.log'
                severityThreshold: '%LOG_DEBUG%'

          i18nLogger:
            default:
              options:
                logFileURL: '%FLOW_PATH_DATA%Logs/I18n_Testing.log'
                severityThreshold: '%LOG_DEBUG%'




    object:
      registerFunctionalTestClasses: true

      dependencyInjection:
        excludeClassesFromConstructorAutowiring:
          - '^Neos\\Flow\\Tests\\Functional\\ObjectManagement\\Fixtures\\PrototypeClassH$'

    session:
      name: 'Flow_Testing_Session'

    persistence:
      backendOptions:
        driver: 'pdo_sqlite'
        path: ':memory:'
        username: NULL
        password: NULL
      doctrine:
        cacheImplementation: NULL

        eventSubscribers:
          'Neos\Flow\Tests\Functional\Persistence\Fixtures\EventSubscriber':
            'Neos\Flow\Tests\Functional\Persistence\Fixtures\EventSubscriber'
        eventListeners:
          'Neos\Flow\Tests\Functional\Persistence\Fixtures\EventListener':
            events: ['onFlush', 'preFlush', 'postFlush']
            listener: 'Neos\Flow\Tests\Functional\Persistence\Fixtures\EventListener'

    resource:

      # Definition of resource storages provided by the Flow core.
      # Storages are used for storing and retrieving resources.
      storages:

        #
        defaultPersistentResourcesStorage:
          storage: 'Neos\Flow\ResourceManagement\Storage\WritableFileSystemStorage'
          storageOptions:
            path: '%FLOW_PATH_DATA%Persistent/Test/Resources/'

        #
        customPersistentResourcesStorage:
          storage: 'Neos\Flow\ResourceManagement\Storage\WritableFileSystemStorage'
          storageOptions:
            path: '%FLOW_PATH_DATA%Persistent/Test/CustomResources/'

        #
        defaultStaticResourcesStorage:
          storage: 'Neos\Flow\ResourceManagement\Storage\PackageStorage'

      # Definition of the default resource collections.
      # Collections are used to bundle / group static or persistent resources
      # for common processing and publication.
      collections:

        # Collection which contains all static resources
        static:
          storage: 'defaultStaticResourcesStorage'
          target: 'localWebDirectoryStaticResourcesTarget'
          pathPatterns:
            - '*/Resources/Public/*'

        # Collection which contains all persistent resources
        persistent:
          storage: 'defaultPersistentResourcesStorage'
          target: 'localWebDirectoryPersistentResourcesTarget'

        # Custom collection for persistent resources
        custom:
          storage: 'customPersistentResourcesStorage'
          target: 'customWebDirectoryPersistentResourcesTarget'

      # Definition of the basic resource publication targets.
      targets:
        # Target for publishing static resources to the local web directory
        localWebDirectoryStaticResourcesTarget:
          target: 'Neos\Flow\ResourceManagement\Target\FileSystemSymlinkTarget'
          targetOptions:
            path: '%FLOW_PATH_WEB%_Resources/Testing/Static/Packages/'
            baseUri: '_Resources/Testing/Static/Packages/'

        # Target for publishing persistent resources to the local web directory
        localWebDirectoryPersistentResourcesTarget:
          target: 'Neos\Flow\ResourceManagement\Target\FileSystemSymlinkTarget'
          targetOptions:
            path: '%FLOW_PATH_WEB%_Resources/Testing/Persistent/'
            baseUri: '_Resources/Testing/Persistent/'
            # If the generated URI path segment containing the sha1 should be divided into multiple segments (recommended if you expect many resources):
            subdivideHashPathSegment: false

        # Custom target for publishing persistent resources to the local web directory
        customWebDirectoryPersistentResourcesTarget:
          target: 'Neos\Flow\ResourceManagement\Target\FileSystemSymlinkTarget'
          targetOptions:
            path: '%FLOW_PATH_WEB%_Resources/Testing/Custom/'
            baseUri: '_Resources/Testing/Custom/'
            # If the generated URI path segment containing the sha1 should be divided into multiple segments (recommended if you expect many resources):
            subdivideHashPathSegment: false

    security:
      authentication:
        authenticationStrategy: anyToken

        providers:
          TestingProvider:
            provider: 'Neos\Flow\Security\Authentication\Provider\TestingProvider'
            entryPoint: 'WebRedirect'
            entryPointOptions:
              uri: 'flow/authentication'
          HttpBasicTestingProvider:
            provider: 'Neos\Flow\Security\Authentication\Provider\PersistedUsernamePasswordProvider'
            token: 'Neos\Flow\Security\Authentication\Token\UsernamePasswordHttpBasic'
            requestPatterns:
              'HttpBasicTestPattern':
                pattern: 'ControllerObjectName'
                patternOptions:
                  controllerObjectNamePattern: 'Neos\Flow\Tests\Functional\Security\Fixtures\Controller\HttpBasicTestController'
          UsernamePasswordTestingProvider:
            provider: 'Neos\Flow\Security\Authentication\Provider\PersistedUsernamePasswordProvider'
            token: 'Neos\Flow\Security\Authentication\Token\UsernamePassword'
            requestPatterns:
              'UsernamePasswordTestControllerPattern':
                pattern: 'ControllerObjectName'
                patternOptions:
                  controllerObjectNamePattern: 'Neos\Flow\Tests\Functional\Security\Fixtures\Controller\UsernamePasswordTestController'

    # Setting for functional tests to test global objects in runtime evaluations
    aop:
      globalObjects:
        testContext: 'Neos\Flow\Tests\Functional\Aop\Fixtures\TestContext'

    # Settings for functional tests to test setting designator and setting injection
    tests:
      functional:
        aop:
          pointcutExpressionSettingFilterOptionA: true
        dependencyInjection:
          singletonConstructorArgument: 'setting injected singleton value'
          prototypeConstructorArgument: 'setting injected property value'
        settingInjection:
          someSetting: 'injected setting'
