Can't reference Alice tool in EntityContext after step (KnpLabs / FriendlyContexts) - Behat

I am using the really cool knplabs / friendlycontexts package to test VictoireDCMS, Symantec2 open source DCMS .

In fact, it works very well despite my project (not the basic architecture of Symfony-project, but a set of packages with a functional test application).

But ... I am now blocked to use the alice reference in the EntityContext. The documentation provides the following examples:

user.yml

App\Entity\User:
    user-john:
        firstname: John
        lastname: Doe
    user-admin:
        firstname: Admin
        lastname: Admin

      

my.feature

@alice(User)
Feature: My feature
    The feature description

    Background:
        Given the following products
            | name  | user  |
            | Ball  | John  |
            | Shoes | Admin |

    ...

      

It really looks good and is exactly what I want to do and here is my code:

template.yml (complete file)

Victoire\Bundle\TemplateBundle\Entity\Template:
    template_base:
        name: Base
        ...

      

my.feature (complete file)

Given the following page:
    | name      | slug     | locale | template |
    | tatooine  | tatooine | fr     | base     |

      

Unfortunately it doesn't work as expected and I have this error when running my function:

The expected value of type "Victoire \ Bundle \ TemplateBundle \ Entity \ Template" for the association field "Victoire \ Bundle \ PageBundle \ Entity \ BasePage # $ template" got "string" instead. (Doctrine \ ORM \ ORMInvalidArgumentException)

I cannot figure this out and see no difference between the example and my code ... Any help would be appreciated.

+3


source to share





All Articles