File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1616 MYSQL_ROOT_PASSWORD : root
1717 MYSQL_DATABASE : mysqlreplication_test
1818 ports :
19- - 3306/tcp
19+ - 3310: 3306
2020
2121 steps :
2222 - name : Checkout
5151 run : composer install --prefer-dist --no-progress --no-suggest
5252
5353 - name : Run tests
54- run : vendor/bin/phpunit --coverage-text
54+ run : MYSQL_PORT=3310 vendor/bin/phpunit --coverage-text
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace MySQLReplication ;
6+
7+ class Tools
8+ {
9+ public static function getFromEnv (string $ name , null |int |string $ default = null ): null |int |string
10+ {
11+ $ value = $ _ENV [$ name ] ?: null ;
12+ return $ value ?? $ default ;
13+ }
14+ }
Original file line number Diff line number Diff line change 1515use MySQLReplication \Event \DTO \RotateDTO ;
1616use MySQLReplication \Event \DTO \TableMapDTO ;
1717use MySQLReplication \MySQLReplicationFactory ;
18+ use MySQLReplication \Tools ;
1819use PHPUnit \Framework \TestCase ;
1920use RuntimeException ;
2021
@@ -40,7 +41,7 @@ protected function setUp(): void
4041 ->withUser ('root ' )
4142 ->withHost ('0.0.0.0 ' )
4243 ->withPassword ('root ' )
43- ->withPort (3306 )
44+ ->withPort (( int )Tools:: getFromEnv ( ' MYSQL_PORT ' , 3306 ) )
4445 ->withEventsIgnore ($ this ->getIgnoredEvents ());
4546
4647 $ this ->connect ();
You can’t perform that action at this time.
0 commit comments