db-pgsql icon indicating copy to clipboard operation
db-pgsql copied to clipboard

Add ability to change DB host and port for tests

Open vjik opened this issue 2 years ago • 7 comments

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues -

vjik avatar Jun 23 '23 13:06 vjik

PR Summary

  • Introduced TestEnvironment class Added a new file TestEnvironment.php in the tests/Support/ directory, with methods to retrieve PostgreSQL host and port. This centralizes the access to these values.

  • Modified CommandTest.php Using the new TestEnvironment class to retrieve PostgreSQL host and port for DSN instantiation and assertions in the testShowDatabases() method.

  • Modified PDODriverTest.php Using the new TestEnvironment class to retrieve PostgreSQL host and port for driver instantiation in the testConnectionCharset() method.

  • Modified TestTrait.php Using the new TestEnvironment class to retrieve PostgreSQL host and port in the methods getConnection, getDb, and getDsn. This refactoring centralizes the way these values are used across multiple methods.

what-the-diff[bot] avatar Jun 23 '23 13:06 what-the-diff[bot]

Codecov Report

Patch and project coverage have no change.

Comparison is base (ada7f05) 99.67% compared to head (5fd76d8) 99.67%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #286   +/-   ##
=========================================
  Coverage     99.67%   99.67%           
  Complexity      213      213           
=========================================
  Files            13       13           
  Lines           617      617           
=========================================
  Hits            615      615           
  Misses            2        2           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Jun 23 '23 13:06 codecov[bot]

What is the use case for this change, tests must be run with the default values.

terabytesoftw avatar Jun 23 '23 13:06 terabytesoftw

What is the use case for this change?

Usage two container for tests (PHP and DB) in one network. In this case I need change host to actual.

vjik avatar Jun 23 '23 13:06 vjik

What is the use case for this change?

Usage two container for tests (PHP and DB) in one network. In this case I need change host to actual.

This is not a problem with the package, it is a problem with your configuration.

terabytesoftw avatar Jun 23 '23 13:06 terabytesoftw

What is the use case for this change?

Usage two container for tests (PHP and DB) in one network. In this case I need change host to actual.

This is not a problem with the package, it is a problem with your configuration.

It's package problem that deny change host address.

vjik avatar Jun 23 '23 13:06 vjik

What is the use case for this change?

Usage two container for tests (PHP and DB) in one network. In this case I need change host to actual.

This is not a problem with the package, it is a problem with your configuration.

It's package problem that deny change host address.

Imagine that each user, make a pr to adapt the package to its configuration, for me it should look like this, simple configuration.

terabytesoftw avatar Jun 23 '23 13:06 terabytesoftw