PHPackages                             cjwind/codeception-yii2-event-tester - 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. cjwind/codeception-yii2-event-tester

ActiveLibrary[Testing &amp; Quality](/categories/testing)

cjwind/codeception-yii2-event-tester
====================================

Codeception module for test yii2 event.

v0.1.2(7y ago)010MITPHP

Since Apr 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/cjwind/codeception-yii2-event-tester)[ Packagist](https://packagist.org/packages/cjwind/codeception-yii2-event-tester)[ RSS](/packages/cjwind-codeception-yii2-event-tester/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (8)Used By (0)

Yii2EventTester
===============

[](#yii2eventtester)

[![Build Status](https://camo.githubusercontent.com/62fcab42b78f500cc40368e7dc17d9b6a2851346e5db53eaa4a05bcefae74896/68747470733a2f2f7472617669732d63692e636f6d2f636a77696e642f636f646563657074696f6e2d796969322d6576656e742d7465737465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/cjwind/codeception-yii2-event-tester)

Codeception module which test whether yii2 event is triggered.

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

[](#installation)

```
$ composer require cjwind/codeception-yii2-event-tester

```

Usage
-----

[](#usage)

### Configure

[](#configure)

Enable module in suite configuration. For example, enable module in `unit.suite.yml`:

```
class_name: UnitTester
modules:
    enabled:
      - Asserts
      - Yii2:
            part: [orm, email, fixtures]
      - cjwind\Yii2EventTester\Yii2EventTester
```

### Use in test

[](#use-in-test)

```
namespace tests\unit\models;

use app\models\EventTestedClass;

class EventTestedClassTest extends \Codeception\Test\Unit {
    /**
     * @var \UnitTester
     */
    protected $tester;

    public function testEventTrigger() {
        $obj = new EventTestedClass;
        $this->tester->assertEventTriggered($obj, EventTestedClass::EVENT_FOO, function() use ($obj) {
            $obj->bar();    // Function should trigger event
        });

        $this->tester->assertEventTriggered(EventTestedClass::class, EventTestedClass::EVENT_BAR, function() {
            // Do sth. should trigger EventTestedClass::EVENT_BAR
        });
    }
}
```

Class-level Event
-----------------

[](#class-level-event)

Because object's [trigger()](https://www.yiiframework.com/doc/api/2.0/yii-base-component#trigger()-detail) also invokes class-level handler, trigger assertion of class-level event will pass when the event is triggered by an object.

### License

[](#license)

MIT

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2584d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30bde2469d08c6589d277783d6626be38c63f025b39ddc0d4ee5791b86588a10?d=identicon)[cjwind](/maintainers/cjwind)

---

Top Contributors

[![cjwind](https://avatars.githubusercontent.com/u/1592462?v=4)](https://github.com/cjwind "cjwind (53 commits)")

---

Tags

testingcodeceptionyii2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cjwind-codeception-yii2-event-tester/health.svg)

```
[![Health](https://phpackages.com/badges/cjwind-codeception-yii2-event-tester/health.svg)](https://phpackages.com/packages/cjwind-codeception-yii2-event-tester)
```

###  Alternatives

[allure-framework/allure-codeception

Allure Codeception integration

5212.1M7](/packages/allure-framework-allure-codeception)[contributte/codeception

Integration of Nette framework to Codeception.

27886.9k1](/packages/contributte-codeception)[neronmoon/teamcity-codeception

Integrating codeception builds with codeception

14346.2k](/packages/neronmoon-teamcity-codeception)[saada/yii2-factory-muffin

A Yii2 wrapper for league/factory-muffin with Gii generators.

1554.6k](/packages/saada-yii2-factory-muffin)

PHPackages © 2026

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