PHPackages                             macpaw/behat-redis-context - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. macpaw/behat-redis-context

ActiveSymfony-bundle[Caching](/categories/caching)

macpaw/behat-redis-context
==========================

Behat redis context for testing

v2.0.2(1y ago)6170.8k↓43.3%[1 PRs](https://github.com/MacPaw/behat-redis-context/pulls)MITPHPPHP ^7.4 || ^8.0CI passing

Since Jan 13Pushed 1y ago7 watchersCompare

[ Source](https://github.com/MacPaw/behat-redis-context)[ Packagist](https://packagist.org/packages/macpaw/behat-redis-context)[ RSS](/packages/macpaw-behat-redis-context/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (17)Used By (0)

Symfony Behat Redis Context
===========================

[](#symfony-behat-redis-context)

VersionBuild StatusCode Coverage`main`[![CI](https://github.com/macpaw/BehatRedisContext/workflows/CI/badge.svg?branch=main)](https://github.com/macpaw/BehatRedisContext/actions?query=workflow%3ACI+branch%3Amain)[![Coverage Status](https://camo.githubusercontent.com/af313833725a94a9759ec137021ac73acfa6d0a5b5a2dbc6e4950a982bcc0ecb/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6d61637061772f62656861742d72656469732d636f6e746578742f6d61696e3f6c6f676f3d636f6465636f76)](https://codecov.io/gh/macpaw/behat-redis-context/branch/main)`develop`[![CI](https://github.com/macpaw/BehatRedisContext/workflows/CI/badge.svg?branch=develop)](https://github.com/macpaw/BehatRedisContext/actions?query=workflow%3ACI+branch%3Adevelop)[![Coverage Status](https://camo.githubusercontent.com/fa610509a741469128035492a00efe7684f6e216d0b15ef30c1ded329a6a5d5d/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6d61637061772f62656861742d72656469732d636f6e746578742f646576656c6f703f6c6f676f3d636f6465636f76)](https://codecov.io/gh/macpaw/behat-redis-context/branch/develop)Symfony Behat Redis Context is a package that integrates Redis operations with Behat for behavior-driven development (BDD). This context allows you to store, retrieve, and validate data in Redis as part of your Behat testing scenarios. It's useful when testing applications that depend on Redis for caching, session storage, or data management.

This documentation provides step-by-step guides for installing the package and utilizing each Redis-related step within Behat scenarios.

How to Install Symfony Behat Redis Context
------------------------------------------

[](#how-to-install-symfony-behat-redis-context)

To install Symfony Behat Redis Context, follow these steps:

1. Add the package to your project using composer: ```
    composer require --dev macpaw/behat-redis-context
    ```

For detailed steps and configuration, refer to the [Installation Steps](docs/install.md)

RedisContext Documentation
--------------------------

[](#rediscontext-documentation)

Below are the available Redis operations that you can use in your Behat tests. Each step integrates seamlessly with Redis to ensure data is stored, retrieved, or validated as expected.

### Redis Step Definitions:

[](#redis-step-definitions)

- [Check Any Value by Redis Key](docs/RedisContext/check-any-value-by-key.md)
    Verifies if any value is stored in Redis under a specific key.
- [Check Array Value Stored in Redis](docs/RedisContext/check-array.md)
    Ensures that the stored array or hash in Redis matches the expected structure.
- [Check if Key Exists in Redis](docs/RedisContext/check-key-exist.md)
    Checks whether a specific key exists in Redis.
- [Check Serialized Value in Redis](docs/RedisContext/check-serialized-value.md)
    Verifies that a serialized value stored in Redis matches the expected serialized value.
- [Check String Value in Redis](docs/RedisContext/check-value-in-redis.md)
    Validates if a string value in Redis matches the expected value.
- [Clean Redis Database in Test](docs/RedisContext/clean-db.md)
    Automatically flushes the Redis database before running a scenario to ensure a clean state.
- [Store Serialized Value in Redis](docs/RedisContext/store-seralized-value.md)
    Serializes and stores a value in Redis with a given key.
- [Store String Value in Redis](docs/RedisContext/store-string-value.md)
    Stores a simple string value in Redis under the specified key.

RedisFixtureContext Documentation
---------------------------------

[](#redisfixturecontext-documentation)

Here you can find detailed documentation about using Redis fixtures in Behat:

1. **[How It Works](docs/RedisFixtures/how-works.md)**
    Learn about the inner workings of the RedisFixtureContext and how it integrates with your Behat tests.
2. **[How to Load Fixture Data into Redis](docs/RedisFixtures/how-load-fixture-in-redis.md)**
    A step-by-step guide on how to load predefined data fixtures into Redis using YAML files in Behat.
3. **[Handling Missing Fixture Files](docs/RedisFixtures/handling-missing-fixtures.md)**
    What to do when a specified fixture file is missing and how to handle such errors in your tests.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance46

Moderate activity, may be stable

Popularity36

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~116 days

Recently: every ~70 days

Total

11

Last Release

420d ago

Major Versions

v1.1.0 → v2.0.02024-10-21

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1935412?v=4)[MacPaw Inc.](/maintainers/macpaw)[@MacPaw](https://github.com/MacPaw)

![](https://www.gravatar.com/avatar/415a6c5f079859104abefc3592ee26337cfdb8466a98d1fadcd010072414523e?d=identicon)[Yozhef](/maintainers/Yozhef)

![](https://www.gravatar.com/avatar/d52c67d98f7c8c891f138e54370ee1d38b89d2be5e952eb4b586cdc69a6652eb?d=identicon)[igorgg](/maintainers/igorgg)

---

Top Contributors

[![Yozhef](https://avatars.githubusercontent.com/u/8971757?v=4)](https://github.com/Yozhef "Yozhef (65 commits)")[![cursoragent](https://avatars.githubusercontent.com/u/199161495?v=4)](https://github.com/cursoragent "cursoragent (6 commits)")[![IiiigorGG](https://avatars.githubusercontent.com/u/46721494?v=4)](https://github.com/IiiigorGG "IiiigorGG (3 commits)")[![ScaryDonetskiy](https://avatars.githubusercontent.com/u/12470079?v=4)](https://github.com/ScaryDonetskiy "ScaryDonetskiy (2 commits)")[![zakhar-huzenko](https://avatars.githubusercontent.com/u/26282904?v=4)](https://github.com/zakhar-huzenko "zakhar-huzenko (2 commits)")

---

Tags

backendbddbehat-contextbehat-redis-contextbehat-redis-fixturebehat-testsmacpawredissymfony-behat-redis-contextsymfonyFixtureBDDredisContextBehatMacPaw

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/macpaw-behat-redis-context/health.svg)

```
[![Health](https://phpackages.com/badges/macpaw-behat-redis-context/health.svg)](https://phpackages.com/packages/macpaw-behat-redis-context)
```

###  Alternatives

[macpaw/behat-messenger-context

Behat Context for testing Symfony Messenger component

16232.9k](/packages/macpaw-behat-messenger-context)[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

841.4M16](/packages/tedivm-stash-bundle)[symfony-bundles/redis-bundle

Symfony Redis Bundle

271.1M5](/packages/symfony-bundles-redis-bundle)[dmarynicz/behat-parallel-extension

Parallel extension for Behat

27544.3k](/packages/dmarynicz-behat-parallel-extension)[mmoreram/rsqueue-bundle

Redis Symfony2 Queue Bundle, a simple and soft redis based message queue for symfony2

5360.7k1](/packages/mmoreram-rsqueue-bundle)[novaway/common-contexts

Novaway Behat common contexts

18187.8k3](/packages/novaway-common-contexts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
