PHPackages                             oprudkyi/codeception-events-scripting - 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. [CLI &amp; Console](/categories/cli)
4. /
5. oprudkyi/codeception-events-scripting

ActiveLibrary[CLI &amp; Console](/categories/cli)

oprudkyi/codeception-events-scripting
=====================================

The Codeception extension for automatically running shell scripts on codeception events

v3.0.0(2y ago)1257.3k↓41%51MITPHPPHP &gt;=5.5.9

Since Apr 25Pushed 2y ago2 watchersCompare

[ Source](https://github.com/oprudkyi/codeception-events-scripting)[ Packagist](https://packagist.org/packages/oprudkyi/codeception-events-scripting)[ RSS](/packages/oprudkyi-codeception-events-scripting/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (12)Used By (1)

**oprudkyi/codeception-events-scripting** The [Codeception](http://codeception.com/) extension for automatically running shell scripts on codeception events.

[![Latest Stable Version](https://camo.githubusercontent.com/2b7ad56eaed9350bdb8cd0094ff804991f5baa5950815b7290e5f1aa0454ace7/68747470733a2f2f706f7365722e707567782e6f72672f6f707275646b79692f636f646563657074696f6e2d6576656e74732d736372697074696e672f762f737461626c65)](https://packagist.org/packages/oprudkyi/codeception-events-scripting)[![Total Downloads](https://camo.githubusercontent.com/09ca54003ecece2a4f2697c52a418037a59c28014382e1900e941e33ae928ebb/68747470733a2f2f706f7365722e707567782e6f72672f6f707275646b79692f636f646563657074696f6e2d6576656e74732d736372697074696e672f646f776e6c6f616473)](https://packagist.org/packages/oprudkyi/codeception-events-scripting)[![License](https://camo.githubusercontent.com/f35d40d179bb058ad9b29c3b7b1b433979bc54acef19a7a0be86a0bc19a542d9/68747470733a2f2f706f7365722e707567782e6f72672f6f707275646b79692f636f646563657074696f6e2d6576656e74732d736372697074696e672f6c6963656e7365)](https://packagist.org/packages/oprudkyi/codeception-events-scripting)[![Build Status](https://camo.githubusercontent.com/faf12f11b50bde222ca156425f9905fec4ce588a54f745ed3bbaa19abe37b609/68747470733a2f2f7472617669732d63692e6f72672f6f707275646b79692f636f646563657074696f6e2d6576656e74732d736372697074696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/oprudkyi/codeception-events-scripting)

About
-----

[](#about)

Run shell scripts on codeception's events - before/after tests/suites (like db seeding, stopping-running additional software etc.) Inspired by [Phantoman](https://github.com/site5/phantoman) extension for [Codeception](http://codeception.com/), though allow to run anything in more generic way.

Minimum Requirements
--------------------

[](#minimum-requirements)

- Codeception 2.1.0
- PHP 5.5

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

[](#installation)

This project can be installed via [Composer](http://getcomposer.org). To get the latest version, simply add the following line to the require block of your composer.json file:

```
{
    "require-dev": {
            "oprudkyi/codeception-events-scripting": "*"
    }

}

```

You'll then need to run `composer install` or `composer update` to download the package and have the autoloader updated.

Or run the following command:

```
    composer require oprudkyi/codeception-events-scripting --dev
```

Configuration
-------------

[](#configuration)

Enable extension in the codeception.yml and write commands. Next events are supported:

- BeforeAll - run before tests on every "codecept run"
- AfterAll - run after all tests
- BeforeSuite - run before each suite (use 'suites' array to run only for selected suites)
- AfterSuite - run after each suite (use 'suites' array to run only for selected suites)

supported next attributes:

- command - command line to run (for one-liners you can write command directly)
- description - echoed before command
- params - additional params for command
- ignoreErrors - don't break testing if command fails (failed or retval != 0)
- suites - single name or array of suites to run command for (applied to base name, like 'acceptance' as well to long name 'acceptance (phantom, firefox)')
- environments - single name or array of environments
- platforms - single name or array of platforms (uses `PHP_OS` constant, i.e. the platform where PHP was built, check [here](http://php.net/manual/en/function.php-uname.php) for details)

```
extensions:
    enabled:
        - Codeception\Extension\EventsScripting
    config:
        Codeception\Extension\EventsScripting:
            BeforeAll:
                - command: echo "Before All"
                - command: echo "Before All with Description"
                  description: Description of command
                - echo "Before All single line"
                - command: echo
                  params: "Before All Params"
                  description: Before All with Params
                - command: "false"
                  description: BeforeAll. fail on run but ignore errors
                  ignoreErrors: true
            AfterAll:
                - command: echo "After All"
                - command: uname
                  description: Platform *nx-like
                  platforms: [darwin, linux, bsd, unix]
                - command: ver
                  description: Platform Windows
                  platforms: windows
            BeforeSuite:
                - command: echo "Before acceptance suite"
                  suites: ['acceptance']
                - command: echo "Before any suite"
                - command: echo "Before acceptance suite, phantom environment"
                  suites: ['acceptance']
                  environments: phantom
                - command: echo "Before acceptance suite, phantom,chrome environments"
                  suites: ['acceptance']
                  environments: ['phantom', 'chrome']
            AfterSuite:
                - command: echo "After acceptance suite"
                  suites: 'acceptance'
                - command: echo "After any suite"
```

Real example (start/stop mailcatcher and seed db):

```
        Codeception\Extension\EventsScripting:
          BeforeAll:
              - command: ./artisan db:seed-test --env=testing
                description: Reset db and seed
          BeforeSuite:
              - command: GEM_HOME=vendor/ruby vendor/ruby/bin/mailcatcher --ip 127.0.0.1 --smtp-port 11031 --http-port 11091
                suites: 'acceptance'
                description: Start mailcatcher
          AfterSuite:
              - command: curl -s -X DELETE http://127.0.0.1:11091
                suites: 'acceptance'
                description: Stop mailcatcher
                ignoreErrors: true
```

Testing
-------

[](#testing)

```
cd sample
composer install -n --prefer-source
cd ../test
composer install -n --prefer-source
./vendor/bin/codecept run
```

Contribute
----------

[](#contribute)

This package is (yet) under development and refactoring but is ready for production. Please, feel free to comment, contribute and help. I will be happy to get some help to deliver tests.

License
-------

[](#license)

Codeception's events scripting is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 93.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 ~258 days

Recently: every ~633 days

Total

11

Last Release

1090d ago

Major Versions

v1.0.7 → v2.0.02020-03-10

v2.0.1 → v3.0.02023-05-25

### Community

Maintainers

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

---

Top Contributors

[![oprudkyi](https://avatars.githubusercontent.com/u/3018472?v=4)](https://github.com/oprudkyi "oprudkyi (28 commits)")[![martenb](https://avatars.githubusercontent.com/u/13311472?v=4)](https://github.com/martenb "martenb (2 commits)")

---

Tags

codeceptionshellextension

### Embed Badge

![Health badge](/badges/oprudkyi-codeception-events-scripting/health.svg)

```
[![Health](https://phpackages.com/badges/oprudkyi-codeception-events-scripting/health.svg)](https://phpackages.com/packages/oprudkyi-codeception-events-scripting)
```

###  Alternatives

[samdark/yii2-webshell

A web shell that allows to run yii console commands and create your own commands.

22981.5k1](/packages/samdark-yii2-webshell)[marcocesarato/amwscan

AMWSCAN (Antimalware Scanner) is a php antimalware/antivirus scanner console script written in php for scan your project. This can work on php projects and a lot of others platform.

75317.8k1](/packages/marcocesarato-amwscan)[alecrabbit/php-console-spinner

Extremely flexible spinner for \[async\] php cli applications

24032.0k2](/packages/alecrabbit-php-console-spinner)[mwguerra/web-terminal

A web-based terminal component for Filament/Laravel with command whitelisting and multiple connection types

251.1k](/packages/mwguerra-web-terminal)[bravo3/ssh

Interactive SSH2 suite for PHP 5.4

191.0k1](/packages/bravo3-ssh)

PHPackages © 2026

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