# This file cannot import the main ' config.yml' file because it defines its own
# security configuration and 'config.yml' also contains some basic security configuration
# This avoids the following error:
# Symfony\Component\Config\Definition\Exception\InvalidConfigurationException:
# You are not allowed to define new elements for path "security.firewalls".
# Please define all elements for this path in one config file.

imports:
    - { resource: services.yml }

parameters:
    locale: en
    database_path: '%kernel.project_dir%/../../../build/test.db'

framework:
    secret:          secret
    translator:      ~
    default_locale:  '%locale%'
    test:            ~
    router:          { resource: "%kernel.project_dir%/config/routing_override.yml" }
    form:            true
    validation:      { enable_annotations: true }
    profiler:
        collect: true
    session:
        storage_id: session.storage.mock_file

twig:
    strict_variables: '%kernel.debug%'
    exception_controller: ~

doctrine:
    dbal:
        driver: pdo_sqlite
        path:   '%database_path%'
    orm:
        auto_generate_proxy_classes: true
        auto_mapping: true
        mappings:
            FunctionalTestEntities:
                mapping: true
                type: annotation
                dir: '%kernel.project_dir%/../AppTestBundle/Entity/FunctionalTests/'
                alias: 'FunctionalTests'
                prefix: 'AppTestBundle\Entity\FunctionalTests'
                is_bundle: false

security:
    encoders:
        Symfony\Component\Security\Core\User\User: plaintext
    providers:
        in_memory:
            memory:
                users:
                    admin:
                        password: 'pa$$word'
                        roles: [ROLE_USER, ROLE_ADMIN]
    role_hierarchy:
        ROLE_ADMIN: ['ROLE_BETA']
    firewalls:
        main:
            pattern: ^/
            anonymous: true
            logout: true
            http_basic:
                provider: in_memory
    access_control:
        - { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY }

easy_admin:
    entities:
        Category:
            class: AppTestBundle\Entity\FunctionalTests\Category
            list:
                fields:
                    - { property: 'id' }
                    - { property: 'name', permission: 'ROLE_BETA' }
                    - { property: 'parent', permission: 'ROLE_UNKNOWN_PERMISSION' }
            show:
                fields:
                    - { property: 'id' }
                    - { property: 'name', permission: 'ROLE_BETA' }
                    - { property: 'parent', permission: 'ROLE_UNKNOWN_PERMISSION' }
            edit:
                fields:
                    - { property: 'id' }
                    - { property: 'name', permission: 'ROLE_BETA' }
                    - { property: 'parent', permission: 'ROLE_UNKNOWN_PERMISSION' }
            new:
                fields:
                    - { property: 'id' }
                    - { property: 'name', permission: 'ROLE_BETA' }
                    - { property: 'parent', permission: 'ROLE_UNKNOWN_PERMISSION' }
