Skip to content

Permit to Inject GlpiAsset#620

Open
tsmr wants to merge 9 commits into
pluginsGLPI:mainfrom
InfotelGLPI:InjectGlpiAsset
Open

Permit to Inject GlpiAsset#620
tsmr wants to merge 9 commits into
pluginsGLPI:mainfrom
InfotelGLPI:InjectGlpiAsset

Conversation

@tsmr

@tsmr tsmr commented May 7, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • [X ] I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

Permit to Inject GlpiAsset (and add Injectable Capacity)
Warning this development d'ont add type & model injection of GlpiAsset

@Rom1-B
Rom1-B requested review from Rom1-B and stonebuzz May 7, 2026 13:55
Comment thread inc/commoninjectionlib.class.php
@Herafia

Herafia commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Hello @tsmr,
You can use these commands to resolve the CI issue:
../../vendor/bin/phpstan
../../vendor/bin/php-cs-fixer fix
../../vendor/bin/rector
php bin/console tools:licence_headers_check

Thank you!
Laura - Teclib

@Herafia
Herafia requested a review from Rom1-B July 21, 2026 13:03

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No test (unit or functional) validates that a GlpiAsset custom asset definition can actually be injected end-to-end. Given the size of the change (492 lines, dynamic eval()-based class generation, a new capacity with register/unregister lifecycle), and that the plugin already has unit tests for comparable injection classes (tests/unit/GroupInjectionTest.php, tests/unit/CommonInjectionLibDataAlreadyInDbTest.php), a test is both feasible and needed here. Can you add a unit or functional test that enables IsInjectableCapacity on an asset definition, injects a row through the generated AssetInjection subclass, and asserts the resulting asset item?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants