Ejemplo n.º 1
0
 public function testUpdateLead()
 {
     $token = 'invalid-token';
     $privateToken = 'invalid-private-token';
     $rdstation = new RDStation($token, 'phpunit-test');
     $result = $rdstation->send(array("auth_token" => $privateToken, 'email' => '*****@*****.**', 'tags' => 'test', 'lead' => array("lifecycle_stage" => 1, "opportunity" => true)), 'leads');
     //$this->assertEquals(200, $result->getStatusCode()); // only if a valid token is provided.
     $this->assertContains('Failed to send request', $result->getContents());
 }
Ejemplo n.º 2
0
 public function testSetTimeout()
 {
     $options = ['token_rdstation' => 'xyd', 'identificador' => 'foo', 'client' => ['timeout' => 666]];
     $station = new RDStation($options);
     $httpClient = $station->getClient();
     $reflection = new \ReflectionObject($httpClient);
     $property = $reflection->getProperty('config');
     $property->setAccessible(true);
     $options = $property->getValue($httpClient);
     $this->assertEquals(666, $options['timeout']);
 }
Ejemplo n.º 3
0
<?php

require_once __DIR__ . '/vendor/autoload.php';
use RDStation\RDStation;
use Zend\Http\Request;
$options = ['token_rdstation' => 'Token.....', 'identificador' => 'Teste Manual'];
$data = ['c_utmz' => 'compufacil', 'tags' => '#inativoapagar', 'email' => '*****@*****.**'];
$station = new RDStation($options);
$response = $station->execute('/conversions', Request::METHOD_POST, $data);
var_dump($response);