You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> ℹ️ The bundle should only be enabled in the `test` environment.
58
42
59
-
## Step 2: Configure Behat
43
+
###Step 3: Configure Behat
60
44
61
-
Go to`behat.yml`:
45
+
Update your`behat.yml`:
62
46
63
47
```yaml
64
-
# ...
65
-
contexts:
66
-
- BehatApiContext\Context\ApiContext
67
-
# ...
48
+
default:
49
+
suites:
50
+
default:
51
+
contexts:
52
+
- BehatApiContext\Context\ApiContext
53
+
- BehatApiContext\Context\ORMContext
68
54
```
69
55
70
-
### Optional: Enable ORMContext
56
+
> If you also want to use `ORMContext`, install [macpaw/behat-orm-context](https://github.com/macpaw/behat-orm-context) and follow its setup instructions.
71
57
72
-
If you want to use `ORMContext`, you need to have `doctrine/orm` installed:
58
+
> 📄 **Migration Notice:** `OrmContext` will be removed from `behat-api-context` in the next major release.
59
+
> Please migrate to [`behat-orm-context`](https://github.com/macpaw/behat-orm-context) to avoid test failures.
60
+
> See the full [ORMContext Migration Plan](./docs/ormcontext-migration.md) for step-by-step instructions.
73
61
74
-
```bash
75
-
composer require --dev doctrine/orm
76
-
```
77
-
78
-
Then, update your `behat.yml`:
79
-
80
-
```yaml
81
-
# ...
82
-
contexts:
83
-
- BehatApiContext\Context\ORMContext
84
-
# ...
85
-
```
86
62
87
63
---
88
64
89
65
## Configuration
90
66
91
-
By default, the bundle has the following configuration:
67
+
By default, the bundle provides the following configuration:
68
+
> This bundle does not yet include a Symfony recipe to automatically create the configuration file.
69
+
> If you need a specific configuration, you have to add it manually.
70
+
> [Recipe in progress](https://github.com/MacPaw/BehatRedisContext/issues/2)
The `use_orm_context` parameter is no longer configurable manually. Its value is determined automatically based on whether the Doctrine ORM is installed:
100
-
> **Important:** This logic is applied internally and cannot be overridden via configuration.
77
+
You can also add your own reset manager by overriding the configuration manually in `config/packages/test/behat_api_context.yaml`:
### Step 1: 📦 Add `behat-orm-context` to `composer.json`
4
+
```bash
5
+
composer require --dev macpaw/behat-orm-context
6
+
```
7
+
8
+
### Step 2: 🧩 Register `OrmContext` in `behat.yml`
9
+
```yaml
10
+
default:
11
+
suites:
12
+
default:
13
+
contexts:
14
+
- BehatOrmContext\Context\OrmContext
15
+
16
+
```
17
+
> If you previously used `BehatApiContext\Context\OrmContext`, replace it with `BehatOrmContext\Context\OrmContext`
18
+
19
+
### Step 3: 🧪 Verify Scenarios
20
+
1. Run Behat tests:
21
+
```bash
22
+
vendor/bin/behat
23
+
```
24
+
25
+
2. Ensure that all steps previously relying on OrmContext still work correctly after the migration.
26
+
27
+
### 🚨 Backward Compatibility Notice
28
+
> `OrmContext` will be removed from `behat-api-context` in a future major release. If you don't migrate, your tests will break after updating dependencies.
29
+
30
+
### 🔔 Recommendation
31
+
Perform the migration before the next major release of `behat-api-context` to avoid CI/CD disruptions and unexpected test failures in your production pipeline.
0 commit comments