Skip to content

Commit 0e2a1d8

Browse files
Bug/eventurl as array (#252)
Fix Connect action eventUrl * `eventUrl` should be an array, not string * Updated tests for having Connect event URL be an array * Added changelog for 2.3.3 Co-authored-by: Abel Ng <[email protected]>
1 parent ba6040b commit 0e2a1d8

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2.3.3
2+
3+
### Fixed
4+
5+
* #252 - Connect action's `eventUrl` was being set as a string, changed to single element array of strings
6+
17
# 2.3.2
28

39
### Added

src/Voice/NCCO/Action/Connect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function toNCCOArray(): array
101101

102102
$eventWebhook = $this->getEventWebhook();
103103
if ($eventWebhook) {
104-
$data['eventUrl'] = $eventWebhook->getUrl();
104+
$data['eventUrl'] = [$eventWebhook->getUrl()];
105105
$data['eventMethod'] = $eventWebhook->getMethod();
106106
}
107107

test/Voice/NCCO/Action/ConnectTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function testGeneratesCorrectNCCOArray()
8585
$this->assertSame(6000, $ncco['limit']);
8686
$this->assertSame('https://test.domain/ringback.mp3', $ncco['ringbackTone']);
8787
$this->assertSame(10, $ncco['timeout']);
88-
$this->assertSame('https://test.domain/events', $ncco['eventUrl']);
88+
$this->assertSame(['https://test.domain/events'], $ncco['eventUrl']);
8989
$this->assertSame('POST', $ncco['eventMethod']);
9090
}
9191

@@ -112,7 +112,7 @@ public function testJSONSerializesToCorrectStructure()
112112
$this->assertSame(6000, $ncco['limit']);
113113
$this->assertSame('https://test.domain/ringback.mp3', $ncco['ringbackTone']);
114114
$this->assertSame(10, $ncco['timeout']);
115-
$this->assertSame('https://test.domain/events', $ncco['eventUrl']);
115+
$this->assertSame(['https://test.domain/events'], $ncco['eventUrl']);
116116
$this->assertSame('POST', $ncco['eventMethod']);
117117
}
118118

0 commit comments

Comments
 (0)