subject = new DriverConfigurationFeeder( [ DriverConfigurationFeeder::OPTION_DRIVER_OPTIONS => [ 'OAT\\Library\\DBALSpanner\\SpannerDriver' => [ 'driverOptions' => [ 'driver-option-auth-pool', 'driver-option-session-pool' ] ] ] ] ); $this->subject->setServiceLocator( $this->getServiceLocatorMock( [ Logger::class => $this->createMock(Logger::class), ] ) ); } public function testFeedWithCustomService(): void { $result = $this->subject->feed( [ 'connection' => [ 'driverClass' => 'OAT\Library\DBALSpanner\SpannerDriver', 'driverOptions' => [ 'driver-option-auth-pool' => Logger::class, 'driver-option-session-pool' => new stdClass(), ] ] ] ); $this->assertInstanceOf(Logger::class, $result['connection']['driverOptions']['driver-option-auth-pool']); $this->assertInstanceOf(stdClass::class, $result['connection']['driverOptions']['driver-option-session-pool']); } public function testFeedWithCustomServiceWithEmptyValue(): void { $result = $this->subject->feed( [ 'connection' => [ 'driverClass' => 'OAT\Library\DBALSpanner\SpannerDriver', 'driverOptions' => [ 'driver-option-auth-pool' => null, ] ] ] ); $this->assertNull($result['connection']['driverOptions']['driver-option-auth-pool']); } public function testFeedWithNoDriverOptions(): void { $config = [ 'connection' => [ 'driverClass' => 'OAT\Library\DBALSpanner\SpannerDriver', ] ]; $result = $this->subject->feed($config); $this->assertSame($config, $result); } public function testFeedWithNoDriverClass(): void { $config = [ 'connection' => [] ]; $result = $this->subject->feed($config); $this->assertSame($config, $result); } }