File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ pdo_pgsql
7
7
<?php
8
8
require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc ' ;
9
9
require __DIR__ . '/config.inc ' ;
10
+ if (strpos ($ config ['ENV ' ]['PDOTEST_DSN ' ], 'password= ' ) === false && !isset ($ config ['ENV ' ]['PDOTEST_PASS ' ])) {
11
+ die ('skip: no password ' );
12
+ }
10
13
PDOTest::skip ();
11
14
?>
12
15
--FILE--
@@ -17,12 +20,12 @@ $dsnWithCredentials = $config['ENV']['PDOTEST_DSN'];
17
20
$ user = $ config ['ENV ' ]['PDOTEST_USER ' ] ?? null ;
18
21
$ password = $ config ['ENV ' ]['PDOTEST_PASS ' ] ?? null ;
19
22
if (!$ user ) {
20
- preg_match ('/user=([^ ]*?) / ' , $ dsnWithCredentials , $ match );
21
- $ user = $ match [1 ] ?? null ;
23
+ preg_match ('/user=([^ ]*?)/ ' , $ dsnWithCredentials , $ match );
24
+ $ user = $ match [1 ] ?? '' ;
22
25
}
23
26
if (!$ password ) {
24
27
preg_match ('/password=([^ ]*?)/ ' , $ dsnWithCredentials , $ match );
25
- $ password = $ match [1 ] ?? null ;
28
+ $ password = $ match [1 ] ?? '' ;
26
29
}
27
30
$ dsn = str_replace ("user= {$ user }" , '' , $ dsnWithCredentials );
28
31
$ dsn = str_replace ("password= {$ password }" , '' , $ dsn );
You can’t perform that action at this time.
0 commit comments