Skip to content

Add a kernel test for the bundle using nyholm/symfony-bundle-test - #39

Merged
loevgaard merged 1 commit into
masterfrom
add-bundle-integration-test
Sep 21, 2026
Merged

loevgaard merged 1 commit into
masterfrom
add-bundle-integration-test

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Summary

Adds tests/SetonoBotDetectionBundleTest.php, a kernel test built with nyholm/symfony-bundle-test. It boots a real kernel with FrameworkBundle, TwigBundle and this bundle, and checks:

  • Services: the four services resolve to the right classes. As in GlsWebserviceBundle's kernel test, a test compiler pass makes the bundle's services public first, because Symfony removes unused private services when it compiles the container.
  • Twig functions: is_bot() and is_bot_request() work through the container's real twig service, with a bot request on the request stack. The existing tests cover the extension and the service definitions only in isolation.

New dev dependencies:

  • nyholm/symfony-bundle-test ^3.1, the first version that supports Symfony 8
  • symfony/framework-bundle and symfony/twig-bundle, which the test uses directly, so the dependency analyser needs them declared

Test plan

Run locally:

Setup PHPStan PHPUnit (64 tests)
PHP 8.1, lowest (Symfony 6.4.0) pass pass
PHP 8.1, highest (Symfony 6.4) pass pass
PHP 8.3, lowest (Symfony 7.4.0) pass pass
PHP 8.4, lowest (Symfony 8.0.0) pass pass
PHP 8.4, highest (Symfony 8.1) pass pass

With lowest dependencies, the run also shows Twig's known PHPUnit deprecations and skipped legacy test. With Symfony 8.0 at lowest versions it additionally prints 7 PHP deprecations from old Symfony package versions installed alongside it. None of them fail the build.

  • ECS, composer-normalize and the dependency analyser pass on PHP 8.4 with highest dependencies
  • CI is green

Boots a real kernel with FrameworkBundle, TwigBundle and this bundle, and
checks that the bundle's services are registered and that the is_bot()
and is_bot_request() Twig functions work through the container.
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.00%. Comparing base (279f467) to head (ff2ce49).

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #39   +/-   ##
=========================================
  Coverage     60.00%   60.00%           
  Complexity       13       13           
=========================================
  Files             5        5           
  Lines            90       90           
=========================================
  Hits             54       54           
  Misses           36       36           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@loevgaard
loevgaard merged commit 42af3e3 into master Sep 21, 2026
54 checks passed
@loevgaard
loevgaard deleted the add-bundle-integration-test branch September 21, 2026 08:59
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.

1 participant