mtz/behat-doctine-context

A syntactic sugar for creating entities from the behat feature file

1.1 2022-08-19 15:55 UTC

This package is auto-updated.

Last update: 2024-04-11 18:02:29 UTC


README

Example of behat.yml configuration

default:
    suites:
        default:
            contexts:
                - MTZ\BehatContext\Doctrine\DoctrineContext

Also put next to the config/services_test.yaml file:

services:
    _defaults:
        autowire: true
        autoconfigure: true

    MTZ\BehatContext\Doctrine\DoctrineContext:

Example of scenario:

  Scenario: My awesome Scenario
    And Created entities of "App\Entity\Post" with
      | id    | title       | description      |
      | 11100 | Some title  | some description |
    Then Instance of "App\Entity\Post" with "id" equal to "11100" contains the following data:
      | id    | title       | description      |
      | 11100 | Some title  | some description |