PHPackages                             chartinger/around-hook-extension - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. chartinger/around-hook-extension

AbandonedArchivedBehat-extension[Testing &amp; Quality](/categories/testing)

chartinger/around-hook-extension
================================

Around hook support for behat v3

214PHP

Since Jun 7Pushed 12y ago1 watchersCompare

[ Source](https://github.com/chartinger/around-hook-extension)[ Packagist](https://packagist.org/packages/chartinger/around-hook-extension)[ RSS](/packages/chartinger-around-hook-extension/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

@AroundScenario hook extension
==============================

[](#aroundscenario-hook-extension)

Around hook support for Behat 3

This project aims to mimic the [Cucumber around feature](https://github.com/cucumber/cucumber/wiki/Hooks) in Behat 3.x

Example
-------

[](#example)

Given you want to run the same Scenario with multiple screen resolutions it could look like this:

```
...
  /**
   * @AroundScenario
   */
  public function runWithMultipleWindowSizes(AroundScenarioScope $scope)
  {
    $this->width = 1920;
    $scope->callBlock(" [1920]");
    $this->width = 800;
    $scope->callBlock(" [800]");
  }

  /**
   * @BeforeScenario
   */
  public function resizeWindow()
  {
    $this->getSession()->resizeWindow($this->width, $this->height);
  }
...
```

Where in the optional parameter of `callBlock()` you can define a suffix to the scenario title

Example output of Behat could be:

```
...
  Scenario: Simpler Test [1920]
    Given I am on "http://somehomepage"
    When I do something
    Then i should see "Hello World"

  Scenario: Simpler Test [800]
    Given I am on "http://somehomepage"
    When I do something
    Then i should see "Hello World"

...
```

Installation
------------

[](#installation)

In your `composer.json` add

```
{
    "require": {
        ...
        "chartinger/around-hook-extension": "*@dev"
    }
}
```

and update your dependencies

Usage
-----

[](#usage)

To activate this extension add this to your `behat.yml`

```
default:
  extensions:
    chartinger\Behat\AroundHookExtension\AroundHookExtension: ~
```

You can now use the `@AroundScenario` annotation in your Behat Context

```
  use chartinger\Behat\AroundHookExtension\AroundScenarioScope;

  ...

  /**
   * @AroundScenario
   */
  public function aroundScenario(AroundScenarioScope $scope)
  {
    $scope->callBlock();
  }
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1876970?v=4)[Christian Hartinger](/maintainers/chartinger)[@chartinger](https://github.com/chartinger)

---

Top Contributors

[![chartinger](https://avatars.githubusercontent.com/u/1876970?v=4)](https://github.com/chartinger "chartinger (7 commits)")

### Embed Badge

![Health badge](/badges/chartinger-around-hook-extension/health.svg)

```
[![Health](https://phpackages.com/badges/chartinger-around-hook-extension/health.svg)](https://phpackages.com/packages/chartinger-around-hook-extension)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)[gong023/assert_chain

enable you to use phpunit assert with method chain

1478.9k3](/packages/gong023-assert-chain)

PHPackages © 2026

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