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 today

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

Maintenance33

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

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://avatars.githubusercontent.com/u/7457290?v=4)[Antonio Pedicini](/maintainers/apedicdev)[@apedicdev](https://github.com/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

[dms/phpunit-arraysubset-asserts

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

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

PHPackages © 2026

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