Skip to content

Update component - #27

Merged
javihgil merged 3 commits into
6.0from
component-improvements
Mar 27, 2026
Merged

Update component#27
javihgil merged 3 commits into
6.0from
component-improvements

Conversation

@javihgil

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the bundle’s test infrastructure (unit + functional), modernizes PHPUnit configuration, and adjusts CI to generate/upload coverage while expanding the test application wiring needed for end-to-end flow coverage.

Changes:

  • Add unit tests for security voters and Doctrine SQL filters, plus functional tests covering public/auth/admin flows.
  • Expand the Symfony test application setup (kernel, security/routing/twig, fixtures, templates, mailer stub) to support functional testing.
  • Modernize PHPUnit/CI configuration (PHPUnit 12, coverage reports, Codecov upload) and refresh repository docs/policies.

Reviewed changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/bootstrap.php Adds conditional bootstrap (skip when no tests / no sqlite) and prepares DB + fixtures for functional tests.
tests/Unit/Security/Authorization/Voter/SwitchUserVoterTest.php New unit tests for SwitchUserVoter behavior.
tests/Unit/Security/Authorization/Voter/AdminAdministratorsActionsVoterTest.php New unit tests for AdminAdministratorsActionsVoter behavior.
tests/Unit/Doctrine/Filter/UserFilterTest.php New unit tests for UserFilter SQL constraint output.
tests/Unit/Doctrine/Filter/AdminFilterTest.php New unit tests for AdminFilter SQL constraint output.
tests/TestApplication/templates/sfs_components/paginator/table.html.twig Adds minimal paginator component template for test app rendering.
tests/TestApplication/templates/sfs_components/forms/admin-horizontal.html.twig Adds minimal form theme placeholder for admin templates in tests.
tests/TestApplication/templates/base.html.twig Adds base layout for test app templates.
tests/TestApplication/templates/admin/layout.html.twig Adds minimal admin layout extending base.
tests/TestApplication/src/TestUserMailer.php Adds a no-op mailer implementation for tests.
tests/TestApplication/src/Kernel.php Registers extra bundles and configures cache/log dirs under temp for tests.
tests/TestApplication/src/Entity/User.php Updates test User entity to include password/confirmable support and typed methods.
tests/TestApplication/src/DataFixtures/AppFixtures.php Adds grouped fixtures to seed a regular user + admin user via UserManager.
tests/TestApplication/config/services.yaml Wires fixtures and overrides UserMailerInterface with test mailer.
tests/TestApplication/config/routes.yaml Adds test app routes mapping to SfsUserBundle routes.
tests/TestApplication/config/packages/twig.yaml Adds Twig paths mapping for SfsComponents namespace.
tests/TestApplication/config/packages/sfs_user.yaml Configures login target param and disables invite/history for tests.
tests/TestApplication/config/packages/security.yaml Replaces in-memory users with sfs_user provider + access controls for functional flows.
tests/TestApplication/config/packages/framework.yaml Sets enabled locales for the test app.
tests/TestApplication/config/packages/doctrine.yaml Switches doctrine mapping type to attributes for test entities.
tests/Functional/PublicFlowsTest.php Adds functional coverage for login/register/reset-password flows.
tests/Functional/AdminFlowsTest.php Adds functional coverage for authenticated preferences and admin list pages.
tests/Functional/AbstractWebTestCase.php Adds shared helpers + sqlite availability skip logic for functional tests.
src/Security/Authorization/Voter/SwitchUserVoter.php Adjusts vote() signature for compatibility (removes Vote type).
src/Security/Authorization/Voter/AdminAdministratorsActionsVoter.php Adjusts vote() signature for compatibility (removes Vote type).
src/Mime/Example/Model/ExampleUser.php Adds eraseCredentials() implementation.
src/Doctrine/Filter/UserFilter.php Widens addFilterConstraint() alias param type for compatibility.
src/Doctrine/Filter/AdminFilter.php Widens addFilterConstraint() alias param type for compatibility.
src/DependencyInjection/SfsUserExtension.php Uses interface_exists() for MailerInterface presence check.
phpunit.xml.dist Updates PHPUnit schema path, adds cacheDirectory, configures source/coverage reports.
config/services/mailer.yaml Adds service defaults to support autowire/autoconfigure.
composer.json Adds PHPUnit dependency, removes phpunit-bridge, and enables coverage in run-tests script.
SECURITY.md Adds repository security policy.
README.md Updates badges/links and points contributing/security to dedicated docs.
FEATURES.md Adds feature overview documentation.
CONTRIBUTING.md Adds contributor workflow instructions.
.gitignore Ignores PHPUnit cache directory.
.github/workflows/ci.yml Installs sqlite extensions, runs PHPUnit, and uploads coverage to Codecov.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Unit/Security/Authorization/Voter/SwitchUserVoterTest.php
Comment thread .github/workflows/ci.yml
Comment thread composer.json
@javihgil
javihgil merged commit 833317e into 6.0 Mar 27, 2026
2 checks passed
@javihgil
javihgil deleted the component-improvements branch March 27, 2026 11:56
@codecov

codecov Bot commented Mar 27, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

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.

3 participants