create(['host' => 'localhost']); static::assertNull($connection->getPath()); } /** * @dataProvider pathDataProvider */ public function testConnectionWithPath(string $path, string $expectedPath): void { $factory = new ConnectionFactory( function () { }, [], new ArrayToJSONSerializer(), new NullLogger(), new NullLogger() ); $connection = $factory->create(['host' => 'localhost', 'path' => $path]); static::assertSame($expectedPath, $connection->getPath()); } public function pathDataProvider(): array { return [ ['/', ''], ['/foo', '/foo'], ['/foo/', '/foo'], ]; } }