mtz/behat-doctine-context

A syntactic sugar for creating entities from the behat feature file

Installs: 41

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 1

pkg:composer/mtz/behat-doctine-context

1.1 2022-08-19 15:55 UTC

This package is auto-updated.

Last update: 2025-10-11 21:17:24 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 |