laravel-twilio-programmable-voice-test-rig maintained by vehikl
Description
A laravel library for testing twilio programmable voice twiml flows
Author
Last update
2024/04/05 05:27
(dev-immutable-chaining-on-request-change)
License
Downloads
1
Laravel Twilio Programmable Voice Test Rig
Test your programmable voice twiml call flows, start to finish. Behind the scenes, uses PHPUnit static assertions, and not tested with Pest.
You need this library if you:
- :telephone: Use twilio's programmable voice for handling phone calls
- :mailbox: Have multiple endpoints to handle the flow of a call
- :twisted_rightwards_arrows: Multiple paths for the flow of a call
Quick-Start
<?php
// ...
use Vehikl\LaravelTwilioProgrammableVoiceTestRig\ProgrammableVoiceRig;
// ...
/** @test */
public function itDoesABasicFlow(): void
{
// ...
}
Setting up your tests
Voice Calls
SMS Messaging
API
Assertions
-
assertTwimlEquals(twml, ...replacements)(works like sprintf) -
assertTwimlContains(twml, ...replacements)(works like sprintf) -
assertTwimlOrder([tag1Name, tag2Name]) -
assertRedirect(uri, method) -
assertSay(textFromASayTag) -
assertPlay(file) -
assertDial(phoneNumber) -
assertPause(numberOfSeconds) -
assertStream(websocketUrl) -
assertRecord(attributes) -
assertGather(attributes, children?) -
assertCallStatus(status) -
assertTwilioHit(uri, method = 'POST', byTwimlTag = null) -
assertCallEnded() -
assertRejected(reason)
Contributors
- Ahmed
- Alex
- Brad
- Eric
- Hunter
- Ian
- John I
- John M
- Jeff C
- Justin S
- Ruta