public function testConferenceWithOnHandler() { $say = new Say('Welcome to the conference. Press the pound key to exit.'); // Set up an On object to handle the event. // Note - statically calling the properties of the Event object can be used // as the first parameter to the On Object constructor. $on = new On(Event::$join, NULL, $say); $options = array('id' => 1234, 'mute' => 'false', 'terminator' => '#', 'playTones' => false, 'name' => 'foo', 'on' => $on); $tropo = new Tropo(); $tropo->Conference($options); $this->assertEquals('{"tropo":[{"conference":{"id":1234,"mute":false,"on":{"event":"join","say":{"value":"Welcome to the conference. Press the pound key to exit."},"name":"foo","playTones":false,"terminator":"#"}}]}', sprintf($tropo)); }