Add test for example module

Created on 13 January 2025, 3 months ago

Problem/Motivation

Currently there is no automated test, which proves and demonstrates the functionality. This especially helps for refactoring and compatibility updates.

Proposed resolution

Add a test, which is based on the KernelBaseTest class, install the example module and prove that a form is being altered (e.g. new form field).

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Peter Majmesku
  • Merge request !6#3499316: First running test draft → (Merged) created by Peter Majmesku
  • Pipeline finished with Success
    3 months ago
    Total: 145s
    #395411
  • Pipeline finished with Success
    3 months ago
    Total: 293s
    #395423
  • Pipeline finished with Success
    3 months ago
    Total: 206s
    #395477
  • Pipeline finished with Success
    3 months ago
    Total: 143s
    #395547
  • Pipeline finished with Success
    3 months ago
    Total: 147s
    #395792
  • Pipeline finished with Success
    3 months ago
    Total: 163s
    #395812
  • Pipeline finished with Success
    3 months ago
    Total: 161s
    #395822
  • Pipeline finished with Success
    3 months ago
    Total: 150s
    #395825
  • Pipeline finished with Success
    3 months ago
    Total: 156s
    #395827
  • Pipeline finished with Success
    3 months ago
    Total: 166s
    #395834
  • Pipeline finished with Success
    3 months ago
    Total: 144s
    #395851
  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

    I am done with my changes. Please review. I made the following changes:

    * Fixed Drupal coding standards and Drupal practices
    * Implemented static code analysis via PHPStan and PHPCS
    * Added testing via PHPUnit. The test proves if a new form field is attached via form_decorator_example with the API that form_decorator provides
    * Spellchecker via cspell

  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf
  • Pipeline finished with Success
    3 months ago
    Total: 156s
    #395862
  • 🇩🇪Germany Harlor Berlin

    Yayy tests are running :D

    Thank you!

    Can we separate the tests from the cleanups? Because I'd merge the tests right away.

  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

    The static code analysis is also tests. It's tests without explicit written tests. That way the Drupal coding standards are proven. You are loosing nothing here. I would like to ask you kindly about merging.

  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

    Ah, I've seen your notices for the merge request. Let me check them.

  • Pipeline finished with Success
    3 months ago
    Total: 164s
    #403778
  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

    @harlor: I have answered on your notices. Could you please review again?

  • 🇩🇪Germany Harlor Berlin
  • Pipeline finished with Success
    3 months ago
    Total: 172s
    #403977
  • Pipeline finished with Success
    3 months ago
    Total: 144s
    #404008
  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

    @harlor: I resolved all your notices. Please review.

  • Pipeline finished with Success
    2 months ago
    Total: 189s
    #404708
  • Pipeline finished with Success
    2 months ago
    Total: 144s
    #404710
  • Pipeline finished with Success
    2 months ago
    Total: 145s
    #404716
  • Pipeline finished with Success
    2 months ago
    Total: 144s
    #404721
  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

    @harlor: Thanks for your hints and the suggested changes. 👍 I've tested the module manually on a local Drupal playground site and there were no errors. The tests are all green. Please review.

  • 🇩🇪Germany Harlor Berlin

    Unfortunately I still got some "must be compatible with..." Fatals

  • Pipeline finished with Success
    2 months ago
    Total: 427s
    #410509
  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

    Thanks again for testing. I feel that we are close. :)

    I've resolved your notices. The return type declarations are reverted to the previous state, where they are not causing errors. Please test again.

  • Pipeline finished with Skipped
    2 months ago
    #410567
  • 🇩🇪Germany Harlor Berlin

    Thank you so much!

  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

    Nice! 💪🎉🥳

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024