public function testApplicationCreate()
 {
     $params = new Catapult\Parameters();
     $app = new Catapult\Application();
     $params->setName(__APPLICATION_UNIT_TEST__ . time());
     $app->create($params);
     $this->assertTrue($app->id);
 }
 public function testBatchAllocateTollfree()
 {
     $pn = new Catapult\PhoneNumbers();
     $params = new Catapult\Parameters();
     $params->setZip("20210");
     $numbers = $pn->batchAllocateLocal($params);
     $this->assertTrue($numbers instanceof Catapult\PhoneNumbersCollection);
 }
 public function testMediaText()
 {
     $params = new Catapult\Parameters();
     $params->setFrom(new Catapult\PhoneNumber(__DEFAULT_SENDER__));
     $params->setTo(new Catapult\PhoneNumber(__DEFAULT_RECEIVER__));
     $params->setMedia(new Catapult\MediaURL(__MEDIA_UNIT_TEST_FILE__));
     $message = new Catapult\Message();
     $message->send($params);
     $this->assertEquals($message->media[0], __MEDIA_UNIT_TEST_FILE__);
 }
 public function testDomainsDelete()
 {
     $params = new Catapult\Parameters();
     $domains = new Catapult\Domains();
     $params->setName("A-d-t-4");
     $domains->create($params);
     $id = $domains->id;
     $domains->delete();
     // look it up
     $domains = new Catapult\DomainsCollection();
     $domains = $domains->listAll()->find(array("id" => $id));
     $this->assertTrue($domains->isEmpty());
 }
Exemple #5
0
 public function testGatherCreate()
 {
     $call = new Catapult\Call();
     $params = new Catapult\Parameters();
     $params->setFrom(new Catapult\PhoneNumber(__DEFAULT_SENDER__));
     $params->setTo(new Catapult\PhoneNumber(__DEFAULT_RECEIVER__));
     $call->create($params);
     $call->wait();
     $gather = new Catapult\Gather($call->id);
     $params->setReason("max-digits");
     $params->setDigits("123");
     $gather->create($params);
     $this->assertEquals($gather->digits, "123");
 }
Exemple #6
0
 public function testBridgeCreate()
 {
     $params = new Catapult\Parameters();
     $call = new Catapult\Call();
     $params->setFrom(new Catapult\PhoneNumber(__DEFAULT_SENDER__));
     $params->setTo(new Catapult\PhoneNumber(__DEFAULT_RECEIVER__));
     $call->create($params);
     $call->wait();
     $call1 = new Catapult\Call();
     $params->setFrom(new Catapult\PhoneNumber(__DEFAULT_SENDER__));
     $params->setTo(new Catapult\PhoneNumber(__DEFAULT_RECEIVER__));
     $call1->create($params);
     $call1->wait();
     $bridge = new Catapult\Bridge();
     $bridge->create(array("callIds" => Catapult\CallCombo::Make($call, $call1)));
 }
 public function testStopAudio()
 {
     $params = new Catapult\Parameters();
     $params->setFrom(new Catapult\PhoneNumber(__DEFAULT_SENDER__));
     $call = new Catapult\Call();
     $conference = new Catapult\Conference();
     $conference->create($params);
     $params->setFrom(new Catapult\PhoneNumber(__DEFAULT_SENDER__));
     $params->setTo(new Catapult\PhoneNumber(__DEFAULT_RECEIVER__));
     $params->setConferenceId($conference->id);
     $call->create($params);
     $call->wait();
     $member = $conference->add_member(array("callId" => $call->id, "setJoinTone" => "false"));
     $member->stop_audio();
 }
 public function testEndpointsDeleteAuthToken()
 {
     $params = new Catapult\Parameters();
     $params1 = new Catapult\Parameters();
     $domain = new Catapult\Domains();
     $endpoints = new Catapult\Endpoints();
     $params->setName("A-d-9");
     $params->setDescription("A domains description");
     $domain->create($params);
     $this->toDelete[] = $domain;
     $params1->setName("A-d-e-9");
     $params1->setDescription("a endpoints description");
     $params1->setCredentials(array("password" => "anEndpointsPassword"));
     $params1->setDomainId($domain->id);
     $endpoints->create($params1);
     $this->toDeleteEP[] = $endpoints;
     $endpoint = new Catapult\Endpoints($domain->id, $endpoints->id);
     $token = $endpoint->createAuthToken();
     $delete = $endpoint->deleteAuthToken($token);
     $this->assertTrue(!empty($delete));
 }