PHPackages                             apedik/module-test - 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. apedik/module-test

ActiveMagento2-module[Testing &amp; Quality](/categories/testing)

apedik/module-test
==================

N/A

00PHP

Since Mar 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/apedicdev/module-test)[ Packagist](https://packagist.org/packages/apedik/module-test)[ RSS](/packages/apedik-module-test/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Apedik/Test
===========

[](#apediktest)

This Magento 2 module demonstrates a dynamic approach to adding extension attributes to orders using plugins and `di.xml` configuration.

Purpose
-------

[](#purpose)

The primary purpose of this module is to showcase a flexible and maintainable way to extend the `Magento\Sales\Api\Data\OrderInterface` with custom attributes. Instead of hardcoding the logic for each attribute in a plugin, this approach uses `di.xml` to define the mapping between extension attribute codes and their data sources, which can be either existing order data keys or dedicated hydrator classes for complex logic.

Key Features
------------

[](#key-features)

- **Dynamic Extension Attribute Population:** Adds extension attributes to orders based on `di.xml` configuration.
- **Flexibility:** Easily add or modify extension attributes without changing the plugin's code.
- **Maintainability:** Keeps code clean and organized, reducing the risk of conflicts and making upgrades smoother.
- **Scalability:** Supports a growing number of extension attributes without code bloat.
- **Hydrator Classes (Optional):** Allows for complex attribute logic to be encapsulated in dedicated classes.

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

[](#installation)

1. **Install via Composer (Recommended):**

    ```
    composer require apedik/test
    ```
2. **Enable the module:**

    ```
    bin/magento module:enable apedik_test
    ```
3. **Run setup upgrade:**

    ```
    bin/magento setup:upgrade
    ```
4. **Compile (if needed):**

    ```
    bin/magento setup:di:compile
    ```
5. **Flush cache:**

    ```
    bin/magento cache:flush
    ```

Usage
-----

[](#usage)

After installation, the module will dynamically add the following extension attributes to orders:

- `custom_attribute_1`: Populated with the order's customer email.
- `custom_attribute_2`: Populated with the order's total quantity ordered.
- `complex_attribute`: Populated with a combination of the customer group ID and order status, calculated by a dedicated hydrator class.

To test the module:

1. Place an order in your Magento store or retrieve an existing order.
2. Observe the extension attributes in the order data (e.g., using `bin/magento sales:order:get ` or by inspecting the order in the Magento admin).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 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://www.gravatar.com/avatar/9c8095bbaae20c91a96d4e37cdd52b9c0d90ccd5cdea67c22af0e1a5f7f3be1a?d=identicon)[apedicdev](/maintainers/apedicdev)

---

Top Contributors

[![apedicdev](https://avatars.githubusercontent.com/u/7457290?v=4)](https://github.com/apedicdev "apedicdev (3 commits)")

### Embed Badge

![Health badge](/badges/apedik-module-test/health.svg)

```
[![Health](https://phpackages.com/badges/apedik-module-test/health.svg)](https://phpackages.com/packages/apedik-module-test)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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