Skip to content

Commit

Permalink
symfony sms connector configuration fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sveneld committed Jun 1, 2024
1 parent 842fca5 commit 16f8cbf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/SmsConnector/AbstractConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
$debugMode = false
) {
$this->debugMode = $debugMode;
$connectorConfig = json_decode($configuration->get('connectors') ?? '[]', true)['config'][static::getType()] ?? [];
$connectorConfig = json_decode($configuration->get('connectors')['config'] ?? '[]', true)[static::getType()] ?? [];
$this->checkConfig($connectorConfig);
}

Expand Down
40 changes: 20 additions & 20 deletions tests/SmsConnector/EuroSmsConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ public function testCheckConfig()
->method('get')
->with('connectors')
->willReturn(
json_encode(
[
'config' => [
[
'config' => json_encode(
[
'eurosms' => [
'gatewayId' => 'Id',
'gatewayKey' => 'Key',
'gatewaySenderNumber' => 'SenderNumber',
]
]
]
)
)
]
);
$smsConnector = new EuroSmsConnector(
$configuration,
Expand Down Expand Up @@ -68,17 +68,17 @@ public function testCheckConfigError(
->method('get')
->with('connectors')
->willReturn(
json_encode(
[
'config' => [
[
'config' => json_encode(
[
'eurosms' => [
'gatewayId' => $gatewayId,
'gatewayKey' => $gatewayKey,
'gatewaySenderNumber' => $gatewaySenderNumber,
]
]
]
)
)
]
);
$smsConnector = new EuroSmsConnector(
$configuration,
Expand Down Expand Up @@ -114,17 +114,17 @@ public function testRespond()
->method('get')
->with('connectors')
->willReturn(
json_encode(
[
'config' => [
[
'config' => json_encode(
[
'eurosms' => [
'gatewayId' => 'Id',
'gatewayKey' => 'Key',
'gatewaySenderNumber' => 'SenderNumber',
]
]
]
)
)
]
);
$smsConnector = new EuroSmsConnector(
$configuration,
Expand All @@ -148,17 +148,17 @@ public function testSend()
->method('get')
->with('connectors')
->willReturn(
json_encode(
[
'config' => [
[
'config' => json_encode(
[
'eurosms' => [
'gatewayId' => 'Id',
'gatewayKey' => 'Key',
'gatewaySenderNumber' => 'SenderNumber',
]
]
]
)
)
]
);
$smsConnector = new EuroSmsConnector(
$configuration,
Expand Down

0 comments on commit 16f8cbf

Please sign in to comment.