Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Symfony Integration issue with TestConnectionFactory

Open
#22 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php, symfony
Domain
backend, testing

Research direction

Start with tests/Repository/PostRepositoryTestWithTestConnectionFactory.php and tests/TestConnectionFactory.php, then inspect config/packages/test/services.yml to trace how the factory is registered for the test environment. Reproduce the failing test and verify that the configured factory is applied instead of attempting the default 127.0.0.1:5432 connection.

Written by the indexing model from the issue text.

Description

I have updated packages to testcontainrs/testcontainers.

I followed the guide in the readme, created a TestConnectionFactory, and declared in the config/packages/test/services.yml.

But when running the tests, it can not find the host 127.0.0.1 and port 5432.

Check the test file: https://github.com/hantsy/symfony-rest-sample/blob/69e8c0d5f91ee999eb2b949bde6a6bf4a21876de/tests/Repository/PostRepositoryTestWithTestConnectionFactory.php

And services.yml file: https://github.com/hantsy/symfony-rest-sample/blob/69e8c0d5f91ee999eb2b949bde6a6bf4a21876de/config/packages/test/services.yml

And the TestConnnectionFactory file :https://github.com/hantsy/symfony-rest-sample/blob/69e8c0d5f91ee999eb2b949bde6a6bf4a21876de/tests/TestConnectionFactory.php

It seems the TestConnectonFactory is not applied at all.

Dominant language
PHP
Stars
215
Forks
34
Avg merge
1h 59m
Merged PRs (30d)
3

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from testcontainers/testcontainers-php

All issues in testcontainers/testcontainers-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.