File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 2121use Bolt \protocol \V4_4 ;
2222use function count ;
2323use Exception ;
24- use Laudis \Neo4j \Authentication \Authenticate ;
2524use Laudis \Neo4j \Bolt \BoltConnectionPool ;
2625use Laudis \Neo4j \Common \Uri ;
2726use Laudis \Neo4j \Contracts \AuthenticateInterface ;
@@ -81,8 +80,6 @@ public function acquire(
8180
8281 $ server = $ this ->getNextServer ($ table , $ config ->getAccessMode ()) ?? $ uri ;
8382
84- $ authenticate = Authenticate::fromUrl ($ uri );
85-
8683 if ($ server ->getScheme () === '' ) {
8784 $ server = $ server ->withScheme ($ uri ->getScheme ());
8885 }
Original file line number Diff line number Diff line change 1515
1616use function count ;
1717use InvalidArgumentException ;
18+ use Laudis \Neo4j \Authentication \Authenticate ;
19+ use Laudis \Neo4j \Basic \Driver ;
1820use Laudis \Neo4j \ClientBuilder ;
21+ use Laudis \Neo4j \Common \Uri ;
1922use Laudis \Neo4j \Contracts \FormatterInterface ;
2023use Laudis \Neo4j \Contracts \TransactionInterface ;
2124use Laudis \Neo4j \Databags \Statement ;
@@ -37,6 +40,21 @@ protected static function formatter(): FormatterInterface
3740 return OGMFormatter::create ();
3841 }
3942
43+ public function testDifferentAuth (): void
44+ {
45+ foreach (self ::buildConnections () as $ connection ) {
46+ $ uri = Uri::create ($ connection );
47+
48+ $ auth = Authenticate::fromUrl ($ uri );
49+ $ uri = $ uri ->withUserInfo ('' );
50+
51+ $ driver = Driver::create ($ uri , null , $ auth );
52+ self ::assertTrue ($ driver ->verifyConnectivity ());
53+
54+ self ::assertEquals (1 , $ driver ->createSession ()->run ('RETURN 1 AS one ' )->first ()->get ('one ' ));
55+ }
56+ }
57+
4058 public function testEqualEffect (): void
4159 {
4260 if (count ($ this ->connectionAliases ()) === 1 ) {
You can’t perform that action at this time.
0 commit comments