Skip to content

vehikl/laravel-twilio-programmable-voice-test-rig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • ☎️ Use twilio's programmable voice for handling phone calls
  • 📫 Have multiple endpoints to handle the flow of a call
  • 🔀 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

About

A set of classes for testing Twilio Programmable Voice twiml flows

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages